I am trying to initiate fancybox popup on page unload (i.e. when the user closes the browser window). I managed to find the following script which does the opposite (launches when the page loads). How can I reverse this code so that it executes on body unload?
JQuery doesn’t have processing for the beforeunload event as it is not a standard event. You would therefore need to use ordinary JavaScript calls to process that particular event in the browsers that support it.