kylefox / jquery-modal

The simplest possible modal for jQuery
http://jquerymodal.com/
Other
2.61k stars 663 forks source link

Use Javascript to close only the active modal #240

Open stephenllai opened 5 years ago

stephenllai commented 5 years ago

When multiple modals are stacked, $.modal.close(); makes all modals closed. Only rel="modal:close" can be used for closing the active model.

If I really want to use Javascript for closing only the active modal, any idea?

limiu82214 commented 5 years ago

try this. $.modal.getCurrent().close();