I have a div that gets hidden and displayed, via .hide() and .show(). When it is displayed by .show() I need it to do some stuff. Is there any way I can setup a custom event listener that fires a callback when the div goes from hidden to visible? I can make a function and call it wherever I would call $(#myDiv").show() but that happens in multiple places and I would like to keep this all in one place.
I have a div that gets hidden and displayed, via .hide() and .show() .
Share
You can pass a function callback into the show method which will execute after the show has completed: