I am using a query bumpbox plugin with the webpage, I am working on but I can still scroll away from the bumpbox when I am using it. I was wondering if there was some sort of jquery method that will keep the webpage from scrolling or just scroll the opposite way with the same distance that the user scrolled.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It's hard to be specific with no code posted, but to prevent scrolling you could do something like :
$(window).on('scroll', function() {
$(this).scrollTop(100); //sets the scrollposition to 100px
});
FIDDLE
回答2:
Easiest way to achieve this
$("body").css("overflow", "hidden");