我有表格,我在X轴和Y轴上滚动(with JQuery
)。但是当桌子滚动时,它们就像摇晃一样。
... 所以我的问题是:为什么会发生这种震动,我该如何防止这种震动?
var leftOffset = parseInt($(".tablecontainer").css('margin-left'));
hhOffset = parseInt($(".headsholder").css('margin-left'));
fixOffset = parseInt($(".fixedphead").css('margin-left'));
eisastanaYOffset = parseInt($(".eisastana").css('margin-left'));
$(".contentbox").scroll(function(){
$(".tablecontainer").css({
'margin-left': $(this).scrollLeft() + leftOffset
});
$(".tableheads").css({
'margin-left': -$(this).scrollLeft()
});
$(".headsholder").css({
'margin-left': hhOffset - $(this).scrollTop()
});
$(".fixedphead").css({
'margin-left': fixOffset -$(this).scrollTop()
});
$(".eisastana").css({
'margin-left': eisastanaYOffset -$(this).scrollTop()
});
});
答案 0 :(得分:0)
我使用 .stop() - Jquery.stop().animate();
- 并且停止了摇晃。