Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. jQuery(document).ready(function($) {
  2.  
  3. // Store the window width
  4. var windowWidth = $(window).width();
  5.  
  6. // Resize Event
  7. $(window).resize(function(){
  8.  
  9. // Check window width has actually changed and it's not just iOS triggering a resize event on scroll
  10. if ($(window).width() != windowWidth) {
  11.  
  12. // Update the window width for next time
  13. windowWidth = $(window).width();
  14.  
  15. // Do stuff here
  16.  
  17. }
  18.  
  19. // Otherwise do nothing
  20.  
  21. });
  22.  
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement