覆盖浏览器滚动行为? [英] Overriding browser scrolling behavior?

查看:57
本文介绍了覆盖浏览器滚动行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户界面的想法,需要覆盖浏览器的滚动功能,所以我可以为滚动操作创建自己的行为。

I have an user interface idea that requires overriding the browser's scroll functionality so I can create my own behaviors for the scroll action.

有没有办法防止当用户滚动时滚动窗口?

Is there a way to prevent the window from scrolling when the user scrolls?

推荐答案

你可以尝试这个

​$(window).scroll(function() {
   $(this).scrollTop(0);
});​​

DEMO

这篇关于覆盖浏览器滚动行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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