如何使用相同的弹出按钮在新选项卡中打开另一个链接

时间:2015-05-11 14:14:20

标签: javascript html ajax button popup

我正在使用一个按钮打开一个ajax html弹出窗口,点击相同的按钮我想在新标签页中打开另一个页面...任何帮助表示赞赏

这是我正在使用的HTML代码

<a href="test.html" class="ajax-popup-link"><button type="button" style="background:green;float:right;">Activate</button></a>

这是javascript函数

<script src="../assets/jquery.magnific-popup.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.ajax-popup-link').magnificPopup({
    type: 'ajax',
    overflowY: 'scroll',
 closeOnContentClick: false
});
});</script>

1 个答案:

答案 0 :(得分:1)

向其添加另一个事件:

$('.ajax-popup-link').click(function(){
     window.open("/some-link.html"); // you can pass options
});
相关问题