我有一个非常简单的放大弹出模式,其中有一个链接。但是,当单击链接时,不会加载 URL,继续的唯一方法是关闭模式。这是我启动弹出窗口的代码:
jQuery(document).ready(function( $ ) {
$('.popup-content').magnificPopup({
type: 'inline',
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'scroll',
closeBtnInside: true,
preloader: false,
callbacks: {
beforeOpen: function() {
this.st.mainClass = this.st.el.attr('data-effect');
}
},
midClick: true,
removalDelay: 300
});
});
还有我的 HTML:
<a class="popup-content" href="#modal" data-effect="my-mfp-slide-bottom">Open popup link</a>
<div id="modal" class="zoom-anim-dialog mfp-hide">
<a href="http://example.com">This link does not work</a>
</div>
最佳答案
添加onclick='window.open("https://example.com");'
到你的 anchor 标签。所以现在你的链接看起来像
<a href="http://example.com" onclick='window.open("https://example.com");'>This link does not work</a>
关于javascript - 放大弹出模式内的链接不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31631445/