我正在使用一个按钮打开 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>
最佳答案
向其中添加另一个事件:
$('.ajax-popup-link').click(function(){
window.open("/some-link.html"); // you can pass options
});
关于javascript - 如何使用相同的弹出按钮在新选项卡中打开另一个链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30170009/