Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var resizeTimer = false;
  2.  
  3. $(window).on('resize', function(e) {
  4.  
  5. if( !resizeTimer ) {
  6. $(window).trigger('resizestart');
  7. }
  8.  
  9. clearTimeout(resizeTimer);
  10. resizeTimer = setTimeout(function() {
  11.  
  12. resizeTimer = false;
  13. $(window).trigger('resizeend');
  14.  
  15. }, 250);
  16.  
  17. }).on('resizestart', function(){
  18. console.log('Started resizing the window');
  19. }).on('resizeend', function(){
  20. console.log('Done resizing the window');
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement