在关闭Reveal Modal之前触发事件?

时间:2015-05-20 14:52:51

标签: javascript jquery zurb-foundation

我正在使用Foundation Reveal模式。在模态本身关闭之前我需要一个抽屉完全关闭并变成display:none;

当前代码同时关闭抽屉和显示模式,因此在抽屉完全关闭之前,显示模式为display:none;

$(document).on('close.fndtn.reveal', '[data-reveal]', function () {
    timber.quickShopDrawer.close();
  });

我意识到我告诉它在关闭基础上关闭抽屉显示模式我只是无法弄清楚如何以相反的方式做到这一点。任何帮助将不胜感激。

或者有没有办法让揭密模态在被关闭时保持为display:block;

1 个答案:

答案 0 :(得分:1)

使用jquery setTimeout方法..我们可以解决这个问题。

 $('selector').click(function() {//close button click function
    timber.quickShopDrawer.close();//close the drawer
    setTimeout(function(){
       $('selector').foundation('reveal', 'close');//modal close
    },800);
 });
相关问题