Window load event with minimum delay


window.load can fire super duper fast if the page is cached. If you want to use that event but make sure a minimum amount of time has passed until it does…

(function fn() { = +new Date;

  $(window).load(function() {

     if (+new Date - < 500) setTimeout(fn, 500);
		 // Do something


  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.