jQuery-Desktop
jQuery-Desktop copied to clipboard
Capturing the window open/close event for use in Javascript programs
Hello,
I am knee deep in working over this amazing thing into a new personal website, and one thing I want to know is how to capture the event of a window getting opened or closed. This is for use with something like, a game in Javascript that exists within a window, so the state can be initialized upon the window being opened, and clearing the state and stopping the game when the window is closed.
Thank you!
The open/close event is captured here…
https://github.com/nathansmith/jQuery-Desktop/blob/master/assets/js/jquery.desktop.js#L256-L260