Last active
June 16, 2016 07:57
-
-
Save tammyhart/6202658 to your computer and use it in GitHub Desktop.
Set the window width to on load and on resize so you can run jQuery at certain browser sizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var windowWidth; | |
function setWidth() { | |
windowWidth = $( window ).width(); | |
} | |
setWidth(); | |
$( window ).resize( setWidth ); | |
if ( windowWidth < 768 ) { | |
... | |
} | |
if ( windowWidth > 320 ) { | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment