单击弹出窗口时,Magnific弹出窗口关闭,模态设置为true。
$(document).ready(function() {
$.magnificPopup.open({
items: {
src: '<div class="white-popup">Our terms and conditions have changed. Please review them: <p><br><a class="popup-modal-dismiss" href="#">Got it</a></p></div>',
type: 'inline',
preloader: false,
modal: true
}
});
$(document).on('click', '.popup-modal-dismiss', function(e) {
e.preventDefault();
$.magnificPopup.close();
});
});
http://codepen.io/anon/pen/YZrRyw
有this post报告类似问题,但我在笔中使用最新版本
答案 0 :(得分:2)
你犯了一个小错误,配置不应该在items{...}
。
$(document).ready(function() {
$.magnificPopup.open({
items: {
src: '<div class="white-popup">Our terms and conditions have changed. Please review them: <p><br><a class="popup-modal-dismiss" href="#">Got it</a></p></div>',
type: 'inline',
},
modal: true,
preloader: false,
});
});
这是更新的代码集:http://codepen.io/anon/pen/EWwObY