我在彈出窗口中有一些窗體控件,並且想阻止用戶在窗體無效時關閉它。如何防止關閉
我想這只是一個測試,但當用戶點擊關閉按鈕彈出仍然關閉,等
$.magnificPopup.open({
items: {
src: '#topic'
},
type: 'inline',
removalDelay: 500, //delay removal by X to allow out-animation
mainClass: 'mfp-3d-unfold',
closeMarkup: '<button title="Close (Esc)" type="button" class="mfp-close"></button>',
midClick: true, // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
callbacks: {
beforeClose: function() {
// Callback available since v0.9.0
return false;
},
close: function() {
// Will fire when popup is closed
return false;
}
}
});
我剛剛發現這個答案 - http://stackoverflow.com/questions/18215477/why-magnific-popup-ajax-box-closes-if-clicked-on-content - 看起來像你可以嘗試添加模態:true而不是closeOnContentClick:false – BellamyStudio