How to detect the modal closing event Materialized.js?


How to detect the closing event for materialized.js?

I want to run some JavaScript code when the modal got closed either by clicking on modal close button or pressing escape button or clicking on any other area of the screen.

Looks like you mean closing event for modal of the materializecss framework.

As for 0.97.1 version (15th of September, 2015) When opening a modal, you can pass options (see:, but note, that it's a very delusive description, as the options are not being saved when using lean_modal (, so they should be passed only to openModal.

To sum up:

var onModalHide = function() {
    alert("Modal closed!");

    complete : onModalHide