Posted By

javifr on 10/29/10


Tagged

jquery-resize


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


On window resize event


 / Published in: JavaScript
 

  1. // puedes meter esto dentro del onload de jquery
  2.  
  3.  
  4. function doSomething() {
  5. alert("I'm done resizing for the moment");
  6. };
  7.  
  8.  
  9. var resizeTimer = null;
  10. $(window).bind('resize', function() {
  11. if (resizeTimer) clearTimeout(resizeTimer);
  12. resizeTimer = setTimeout(doSomething, 100);
  13. });
  14.  
  15.  
  16.  

Report this snippet  

You need to login to post a comment.