相关疑难解决方法(0)

Animate scrollTop无法在firefox中运行

这个功能很好.它将主体滚动到所需容器的偏移量

function scrolear(destino){
    var stop = $(destino).offset().top;
    var delay = 1000;
    $('body').animate({scrollTop: stop}, delay);
    return false;
}
Run Code Online (Sandbox Code Playgroud)

但不是在Firefox中.为什么?

-编辑-

要在接受的答案中处理de double触发器,我建议在动画之前停止元素:

$('body,html').stop(true,true).animate({scrollTop: stop}, delay);
Run Code Online (Sandbox Code Playgroud)

firefox jquery scrolltop

164
推荐指数
3
解决办法
9万
查看次数

标签 统计

firefox ×1

jquery ×1

scrolltop ×1