First of all, sorry for the double question, but I feel this is a rather different manner.
I have:
$(document).ready(function(){
$('#container').fadeOut(0);
$('#container').fadeIn(500);
$(window).unload(function(){
alert("Hello.");
$('#container').fadeOut(500);
});
});
It should show up the page by fading it in, and make it unload by fading it out. Though, when I quit the page or submit the form that's in it, I only see the alert, but after I press OK on it, the page just disappears and the next one appears. The fade isn't executed.
How can I fix this?