views:

26

answers:

2

How do I refresh the page(from overlay) using jQuery with Fade In effect?

I have a div tag on the page and I open that like overlay using jQuery. Once I click "Ok" or "Cancel" on that overlay I need to refresh the page(to reload the data) closing the overlay with Fade In/Fade Out effect.

Ajax update panel is doing partial post back and user doesn't see the page is getting refreshed. I wanted to do same thing using jQuery with Fade In/Fade Out effect.

Any help/suggestion would be appreciated.

+3  A: 

To refresh the entire page, you can use:

window.location = window.location;
ichiban
I guess the question wasn't about how simply refresh the entire page. Because it could be done with location.reload(true).
Artem Barger
A: 

You can try doing something like this.

$( "body").fadeOut( function(){
       location.reload(true); 
       setTimeout( function(){
           $(body).fadeIn();
       }, 5000);
 });

While was writing found a better way:

$( "body").fadeOut( 
           function(){
              location.reload(true);
              $( document).ready( function(){$(body).fadeIn();}); 
           });
Artem Barger