js 鼠标滚动 禁用 启用
function disabledMouseWheel() {
var div = document.getElementById('divid');
if (div.addEventListener) {
div.addEventListener('DOMMouseScroll', scrollFunc, false);
}//W3C
div.onmousewheel = div.onmousewheel = scrollFunc;//IE/Opera/Chrome
}
function scrollFunc(evt) {
evt = evt || window.event;
if (evt.preventDefault) {
// Firefox
evt.preventDefault();
evt.stopPropagation();
} else {
// IE
evt.cancelBubble = true;
evt.returnValue = false;
}
return false;
}
window.onload = disabledMouseWheel;
已做兼容 亲测可用,
js 鼠标滚动 禁用 启用的更多相关文章
- JS鼠标滚动插件scrollpath使用介绍
JS鼠标滚动插件scrollpath:在这个插件中首先要引人的JS是jQuery,因为后面的JS都是基于它的.再者需要引入的是jquery.scrollpath.js.scrollpath.css还有 ...
- js 鼠标滚动到某屏时,加载那一屏的数据,仿京东首页楼层异步加载模式
js用处:在做商城时,首页图片太多,严重影响首页打开速度,所以我们需要用到异步加载楼层.js名称:鼠标滚动到某屏时,加载那一屏的数据,仿京东首页楼层模式js解释:1.用于商城的楼层内容异步加载,滚动条 ...
- JS鼠标滚动事件
-----------------------------//鼠标滚动事件以下是JS临听鼠标滚动事件 并且还考虑到了各浏览器的兼容----------------------------------- ...
- scrollify.js 鼠标滚动
在线实例 实例演示 使用方法 <! doctype html> <html> <head> <script> $(function() { $.scro ...
- js鼠标键禁用功能
页面完全禁用右键 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww ...
- js鼠标滚轮滚动图片切换效果
效果体验网址:http://keleyi.com/keleyi/phtml/image/12.htm HTML文件代码: <!DOCTYPE html PUBLIC "-//W3C// ...
- 原生JS—实现图片循环切换及监测鼠标滚动切换图片
今天我们主要讲讲如何使用原生JS实现图片的循环切换的方法以及如何检测鼠标滚动循环切换图片.多余的话我们就不多说了,我们一个一个开始讲吧. 1 原生JS实现图片循环切换 -- 方法一 在上栗子之前我们 ...
- js 鼠标左键拖动滚动
鼠标左键拖动滚动 原作者: http://blog.csdn.net/lisatisfy/article/details/6606026 本文在源代码的基础上 增加支持水平滚动 的功能 html &l ...
- ASP.NET Boilerplate 学习 AspNet Core2 浏览器缓存使用 c#基础,单线程,跨线程访问和线程带参数 wpf 禁用启用webbroswer右键菜单 EF Core 2.0使用MsSql/MySql实现DB First和Code First ASP.NET Core部署到Windows IIS QRCode.js:使用 JavaScript 生成
ASP.NET Boilerplate 学习 1.在http://www.aspnetboilerplate.com/Templates 网站下载ABP模版 2.解压后打开解决方案,解决方案目录: ...
随机推荐
- swt-designer安装教程
http://jingyan.baidu.com/article/3f16e003c87b082590c10343.html
- [原][c++][数学]osg常用图形数学算法小结
1.cos趋近 // a reasonable approximation of cosine interpolation double smoothStepInterp( double t ) { ...
- [原][osg][osgEarth]EarthManipulator关于oe漫游器的handle部分解读以及修改(仿照谷歌,修改oe漫游器中focal(视角切换)功能 续 二)
bool EarthManipulator::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) ...
- TRMM数据在arcgis打开
基本思路:地图配准 1将投影设置为plate carree(world) ,是在投影坐标系统下的世界中选择,当然为了输入坐标方便,设置属性genral中单位为度,显示为度分秒. 2 首先,要知道打开后 ...
- axios写法
- Codeforces 1077 F2 - Pictures with Kittens (hard version)
F2 - Pictures with Kittens (hard version) 思路: 单调队列优化dp 代码: #pragma GCC optimize(2) #pragma GCC optim ...
- audio进度条
如上图所示:为效果图 代码如下: <!doctype html><html> <head> <meta name="author" con ...
- Unity--- 纹理设置属性 alphaIsTransparency
官方的解释: 意思就是没什么实际效果,只是用做显示用. 参考:https://docs.unity3d.com/ScriptReference/Texture2D-alphaIsTransparenc ...
- Determine destination location of apt-get install <package>?
https://askubuntu.com/questions/129022/determine-destination-location-of-apt-get-install-package dpk ...
- 非常好的 gdb tui 的文章
http://beej.us/guide/bggdb/ Help Commands help command Get help on a certain command apropos keyword ...