惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - 所言非虚

未来谁才是移动互联网的入口? [Oracle]Sqlplus连接成功,但pl/sql连接不成功,提示“ora-12145:无法解析指定的连接标识符” Windows待机、休眠、睡眠的区别以及程序运行策略 [Worldwind]worldwind源码编译 windows server 2008 x64下oracle 10gR2的安装方法 [长期]常见问题收集 最佳编程字体推荐 GDAL问题收集 向量点积与叉积的定义及应用 空间平面法向量求法 【解决】加载图片"内存不足"问题 【原创】随鼠标移动显示地图经纬度 - 所言非虚 - 博客园 【原创】客户端添加兴趣点,并随地图变化而变化 - 所言非虚 - 博客园 【原创】利用ESRI自带的符号库进行符号化 FireFox与IE的兼容 DIV的精确定位 - 所言非虚 - 博客园 ArcGIS Server开发的一些小经验 ArcSDE C API在.NET中的调用 - 所言非虚 [译]ArcGIS Server Map Service Cache的组织结构
【转】兼容IE和FireFox的鼠标滚轮事件
所言非虚 · 2008-04-21 · via 博客园 - 所言非虚

滚轮IE和Firefox的代码不一样:
IE是mousewheel事件,Firefox是DOMMouseScroll事件
事件属性,IE是event.wheelDelta,Firefox是event.detail
属性的方向值也不一样,IE向上滚 > 0,Firefox向下滚 > 0

  1. //滚轮放大或缩小,基于Prototype 1.6
  2. var scrollfunc = function(event) {
  3.         var direct = 0;
  4.         if (event.wheelDelta) {
  5.                 direct = event.wheelDelta > 0 ? 1 : -1;
  6.         } else if (event.detail) {
  7.                 direct = event.detail < 0 ? 1 : -1;
  8.         }
  9.         zoom(direct);
  10. };
  11. Event.observe(document, 'mousewheel', scrollfunc);
  12. Event.observe(document, 'DOMMouseScroll', scrollfunc); //firefox