jquery on scroll x pixels

Solutions on MaxInterview for jquery on scroll x pixels by the best coders in the world

showing results for - "jquery on scroll x pixels"
Antonio
01 Feb 2020
1$(document).scroll(function() {
2               var value=$(document).scrollTop();
3
4                if ( value >= 1000 ) { /*do this*/; return;}
5                if ( value >= 500 ) { /*do this*/; return;}
6                if ( value >= 150 ) { /*do this*/; return;}
7                if ( value >= 30 ) { /*do this*/; return;}
8                /* else */
9                /*do this*/
10            });
11
Allan
25 Apr 2019
1 $(document).scroll(function() {
2
3        if ( $(document).scrollTop() >= 1000 ) {
4        } else if ( $(document).scrollTop() >= 500 ) {
5        } else {
6        }
7    });
8
Jonah
15 Jan 2019
1$(document).scroll(function() {
2           var value=$(document).scrollTop();/* <== here*/
3
4            if ( value >= 1000 ) {
5            } else if ( value >= 500 ) {
6            } else {
7            }
8        });
9