I would like to have an animation effect which starts when people leave a page.
I use this currently:
window.onbeforeunload = function (){
alert("test");
console.log("test");
sliderIntervalId = setInterval('SlideDown()',1);
}
While the "test" is indeed logged to the console, the neither the function slideDown
nor the test alert is produced...
Is this normal behavior? Can we use the beforeunload
function only for backend purposes?
P.S. I'm testing on Chrome, that's why I had to use onbeforeUnload
instead of onUnLoad
which seems not to be supported by Chrome?