Last active
November 23, 2015 10:53
-
-
Save joeydenbraven/9f6993a4c70d2ce6c327 to your computer and use it in GitHub Desktop.
jQuery script that will activate for scrolling up or down.
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 iScrollPos = 0; | |
$(window).scroll(function () { | |
var iCurScrollPos = $(this).scrollTop(); | |
if(iCurScrollPos<=300){ | |
//Do nothing within 300px and down range | |
} | |
else { | |
var spacerheight = $('header').height(); | |
if (iCurScrollPos > iScrollPos) { | |
//Scrolling Down | |
} else { | |
//Scrolling Up | |
} | |
iScrollPos = iCurScrollPos; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment