jquery - Doubled page scroll by javascript -


i have code

var scroll = $(window).scrolltop(); $(window).on("scroll", function () {    scroll+=100;    $(window).scrolltop(scroll); //* }) 

but code scroll window loop bottom. how make throttle in order avoid recursion ?

the goal: have 404 page , iframe index page below of 404. , when user try scroll 404 page - index pages scroll top doubled speed

to solve issue took different approach, upon scroll scrolling index location once.

var $window = $(window); var indexlocation = 505;   $window.one("scroll", function(e){     if ($window.scrolltop() < indexlocation){         $("body").animate({scrolltop: indexlocation});     } }); 

also can check out here: http://jsfiddle.net/jsjjk/1/


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -