Created
November 30, 2017 09:01
-
-
Save pagemashine/4821348891af6d57d01e892cb7cf8364 to your computer and use it in GitHub Desktop.
Works at loading and resizing
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
$(document).load($(window).bind("resize", listenWidth)); | |
function listenWidth( e ) { | |
var windowWidth = $(window).width(); | |
if (windowWidth > 767) { | |
stick(); | |
} | |
else { | |
unstick(); | |
} | |
} | |
listenWidth(); // Add this here to execute the funtion onload. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment