有没有办法防止在close
回调中关闭基础揭示模态? 我已经尝试了return false;
和e.preventDefault();
,但似乎都没有任何效果。
.HTML:
<div id="my-modal" class="reveal-modal">
I'm a modal!
</div>
.JS:
$('#my-modal').on('close', function( e ) {
var ok = confirm( 'Are you sure you want to close this?' );
if ( ! ok ) {
e.preventDefault();
return false;
}
}
我在源代码中看不到任何应该提供此功能的内容,不。但是,您应该能够使用close_on_background_click: false
和close_on_esc:false
选项,并滚动自己的关闭按钮来控制该过程。