Magnific popup 关闭时放大弹出调用2确认
我使用放大弹出的形式模态。我想确认用户何时关闭了modal。但是,问题是显示了两个确认。我只想要一个。这是我的密码Magnific popup 关闭时放大弹出调用2确认,magnific-popup,Magnific Popup,我使用放大弹出的形式模态。我想确认用户何时关闭了modal。但是,问题是显示了两个确认。我只想要一个。这是我的密码 <a href="#registration" class="popup-modal"> <span>Register</span> </a> <div id="registration" class="white-popup-block mfp-hide"> &l
<a href="#registration" class="popup-modal">
<span>Register</span>
</a>
<div id="registration" class="white-popup-block mfp-hide">
<button title="Close" type="button" class="mfp-close"><i class="icon-cross" aria-hidden="true"></i></button>
<div class="mfp-text">
<!-- My Form Here -->
</div>
</div>
$('.popup-modal').magnificPopup({
type: 'inline',
preloader: false,
modal: true,
callbacks: {
open: function() {
$.magnificPopup.instance.close = function () {
if (!confirm("Are you sure?")) {
return;
}
$.magnificPopup.proto.close.call(this);
};
}
}
});
$('.popup modal').magnificPopup({
键入:“内联”,
预加载程序:false,
莫代尔:是的,
回调:{
打开:函数(){
$.magnificpoop.instance.close=函数(){
如果(!确认(“您确定吗?”)){
返回;
}
$.magnificpoop.proto.close.call(this);
};
}
}
});
我的代码可能有什么问题。为什么关闭时弹出窗口显示2确认对话框?请帮忙。谢谢 我试过你的代码,我只有1个,也许你的html有另一个元素,带有
弹出模式
类?谢谢:)我解决了这个问题,当我点击关闭图标时,有另一个关闭功能,所以我删除了该功能