停止使用jquery滚动网页 [英] stop scrolling of webpage with jquery

查看:67
本文介绍了停止使用jquery滚动网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用网页上的查询缓冲盒插件,正在研究,但使用缓冲盒时仍可以滚动离开缓冲盒.我想知道是否有某种jquery方法可以阻止网页滚动,或者只是以与用户滚动相同的距离以相反的方式滚动.

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.

推荐答案

在没有代码发布的情况下很难做到明确,但是要防止滚动,您可以执行以下操作:

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

这篇关于停止使用jquery滚动网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆