all articles

android firefox dosn't support scrollTop annimation

2015-07-05 @sunderls

jQuery android firefox scrollTop animation js

description, bug

with jQuery, android firefox doesn't support animation with scrollTop, to create smooth backToTop button.

workaround.

avoid this, or there is some other way that I don't know? please tell me

code

if(isFirefox){
    window.scrollTo(0,0);
} else {
    $('body').animate({
         scrollTop: 0
    }, 100);
}