javascript - Turn off firefox's smooth scrolling? -


firefox's new smooth scrolling feature causes scroll callback trigger @ each step in animation.

demo in ff , chrome see difference

is there way have

  1. only fires 1 event when page has finished scrolling
  2. make page scroll abruptly in chrome

try this:

function throttle( fn, timeout ) {     var tid = 0;     return function() {         cleartimeout( tid );         var args = [].slice.call( arguments ),             ctx = this;          tid = settimeout( function() {             fn.apply( ctx, args );         }, timeout );     }; }  $(window).on("scroll", throttle( function() {     $('div').eq(0).append('scroll happened'); }, 100)); 

it fire scroll once no scroll has happened in 100 milliseconds.

http://jsfiddle.net/nlghs/1/


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -