I'm using the scrollTo jQuery plugin and would like to know if it is somehow possible to temporarily disable scrolling on the window element through Javascript?(我使用的是scrollTo jQuery插件,想知道是否可以通过Java临时禁用window元素上的滚动吗?)
The reason I'd like to disable scrolling is that when you scroll while scrollTo is animating, it gets really ugly ;)(我要禁用滚动的原因是,当您在scrollTo设置动画时滚动时,它真的很难看;))
Of course, I could do a $("body").css("overflow", "hidden");
(当然,我可以做一个$("body").css("overflow", "hidden");
) and then put it back to auto when the animation stops, but it would be better if the scrollbar was still visible but inactive.(然后在动画停止时将其重新设置为自动,但是如果滚动条仍然可见但处于非活动状态会更好。)
ask by Olivier Lalonde translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…