防止在关闭回调中关闭基础揭示



有没有办法防止在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: falseclose_on_esc:false选项,并滚动自己的关闭按钮来控制该过程。

最新更新