when page scrolls 50px down code example
Example 1: jquery on scroll x pixels
$(document).scroll(function() {
if ( $(document).scrollTop() >= 1000 ) {
} else if ( $(document).scrollTop() >= 500 ) {
} else {
}
});
Example 2: jquery on scroll x pixels
$(document).scroll(function() {
var value=$(document).scrollTop();/* <== here*/
if ( value >= 1000 ) {
} else if ( value >= 500 ) {
} else {
}
});