Jquery, FadeIn before unload

Posted by Starboy on Stack Overflow See other posts from Stack Overflow or by Starboy
Published on 2010-04-03T01:07:45Z Indexed on 2010/04/03 1:13 UTC
Read the original article Hit count: 273

Filed under:

I'm trying to accomplish a transition effect if you will. On doc ready div fades out, the problem im having is when a visitor navigates away from the page (or .unload) I want the div to fade back in.

$(document).ready(function(){

$('#overlay').fadeOut(2000, 'easeOutQuad');

});

$(window).beforeunload(function() {

$('#overlay').fadeIn(2000, 'easeOutQuad');

});

© Stack Overflow or respective owner

Related posts about jQuery