Detect Close event of Side nav on MaterializeCSS

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Detect Close event of Side nav on MaterializeCSS



Is there a way to detect the event that will close the side-nav ?



I tried to use the overlay that was being displayed when side nav is open


$('#sidenav-overlay').click(function()
toggleSidebar();
);



However it did not work.
I am not sure what to use based on the documentation, but what I am trying to do was when event that will close the side detected I will call a specific function
like in my case is function toggleSidebar()



Here is the sample fiddle: http://jsfiddle.net/u2nzovd6/





Callback functions in options aren't working?
– Germa Vinsmoke
Jul 30 at 5:39


options




1 Answer
1



There is an option onCloseEnd in Materialize v1 which you should be using. Your fiddle uses a very old 0.95 version


onCloseEnd



Here is how you would use it
http://jsfiddle.net/hv0poe46/





Appreciate your response. Would you be able to create a fiddle for this fix as I am a bit confuse on how to do it? Thank you.
– shifu
Aug 10 at 5:32





I tried to update the version and add onCloseEnd however I encountered error See: jsfiddle.net/u2nzovd6/39
– shifu
Aug 10 at 6:30





Please accept the answer if it works for you
– Maxim Balaganskiy
Aug 10 at 23:45






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard