I have a problem with the scrollTo
function when it is called by a jQuery animate
function.
Here my code:
$("#button").click(function(){
$("body").animate({scrollTop: 1400},"slow");
});
When I click the button, the flicker appears before the body scrolling. For example, I'm on (scroll position) 1000, and when I clicked the button the following happened:
- page/image on (scroll position) 1400 appears, it looks like I have already gone
to (position) 1400
- then it moves again to (position) 1000, this happens so fast
and looks like a flicker
- finally it scrolls to 1400 like a normal scroll..
On firefox it always appears, and sometimes on chrome also.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…