Alex Rivera | Logout

How do I programmatically close an open jquery.reveal.js modal box?

Asked 2011-02-03T09:31:55.850
24

I am using the Reveal jQuery plugin. http://www.zurb.com/playground/reveal-modal-plugin

I need to programmatically close the model box when I am done with it, however that feature is not including directly with the plugin.

According to Dave in the comments page,

"The code is in there, just need to hook it up to be called programmatically."

Edit
Report

1 Answer

2

You can do that while registering your reveal div/element.

suppose, [reveal-div] you are registering for reveal. And suppose you have one button/div [close-reveal] onclick of which you want to close your reveal. Then pass [close-reveal] as [dismissModalClass] as shown below.

    $('.reveal-div').reveal({           
        dismissModalClass : "close-reveal"
    });
answered 2012-06-27T09:34:15.190

Your Answer