javascript - jQuery: Refresh page with fadein and fadeout -


i have snippet make page refresh every minute. however, want page fade out specific color, refresh , fade in again. easy way that?

this code use;

setinterval("refresh();",60000);  function refresh(){   window.location = location.href;  } 

i found code while searching solution, unsure on how can use in interval;

$("body").fadeout(   function(){   location.reload(true);  $( document).ready( function(){$(body).fadein();});  }); 

demo

add css hide body on page load.

body{display:none}; 

then on load, fade body in.

after 60 seconds fade out, trigger page reload putting inside callback executes after fadeout finishes.

$(function(){     $('body').fadein(1000);     settimeout(function(){         $('body').fadeout(1000, function(){             location.reload(true);         });     }, 60000); }); 

no need use setinterval page gets reloaded; settimeout fine.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -