How to use Zurb Foundation reveal with open, opened, close, closed callback functions?

后端 未结 9 535
执念已碎
执念已碎 2021-02-05 01:41

On zurb foundation\'s website at http://foundation.zurb.com/docs/reveal.php they listed some Options including

open: callback function that triggers \'before\' the

9条回答
  •  孤城傲影
    2021-02-05 02:04

    On Zurb Foundation v6, these events were renamed to xxx.zf.reveal:

    • closeme.zf.reveal Fires immediately before the modal opens. Closes any other modals that are currently open
    • open.zf.reveal Fires when the modal has successfully opened.
    • closed.zf.reveal Fires when the modal is done closing.

    Source: http://foundation.zurb.com/sites/docs/reveal.html#js-events

    Examples:

    • Generic callback that will fire for all modals:

      $(document).on('open.zf.reveal', '[data-reveal]', function() {
        console.log('This works');
      });
      
    • Callback that will fire when a specific modal is opened:

      $(document).on('open.zf.reveal', '#[data-reveal]', function() {
        console.log('This works');
      });
      

提交回复
热议问题