Javascript jquery动画隐藏卷轴
我对Javascript jquery动画隐藏卷轴,javascript,jquery,jquery-animate,overflow,Javascript,Jquery,Jquery Animate,Overflow,我对div动画有一个小问题,它是溢出的,在动画过程中滚动条会闪烁 我举了一个快速的例子: $(".div-animate").on("click", function(e){ var toTop = 100, toHeight = $(this).outerWidth(true) + toTop; $(this).animate({ top: toTop, height: toHeight }); }); 如何防止这种
div
动画有一个小问题,它是溢出的
,在动画过程中滚动条会闪烁
我举了一个快速的例子:
$(".div-animate").on("click", function(e){
var toTop = 100,
toHeight = $(this).outerWidth(true) + toTop;
$(this).animate({
top: toTop,
height: toHeight
});
});
如何防止这种小小的“滚动闪烁”?jQuery在使用动画功能时添加了一个溢出:隐藏规则。 你可以做两件事: 1) 修改jQuery源中溢出设置为隐藏的行(只有从站点导入jQuery时才能执行此操作) 2) 强制css中的属性执行以下操作
.div-animate {
overflow: auto !important;
}
这也可以这样做:
$(this).animate({
top: toTop,
height: toHeight
}).css({"overflow":"auto"});
这取决于滚动条我想,无论如何在macosx和FF上,滚动条不会在我的chrome和FF上闪烁,会发生闪烁。该死,为什么我在问之前尝试这个,无论如何,谢谢,会检查js行。这是一个聪明的方法,这样你就不必使用浏览器了!css中的重要标记。好办法!