Remember that .hover()
with only one argument means .hover(handlerInOut)
, i. e. your handler function will be called both on mouseenter
and mouseleave
events. Try using .mouseenter()
instead.
In Chrome this gives me better results - scrolling still freezes after animation, but only for a very short time. (Tested with a very simple webpage).
$(function() {
$('#product-home').mouseenter(function(){
$('html, body').animate({
scrollTop: $("#navigation").offset().top - 250
}, 2000);
return true;
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…