[原] IE模拟鼠标右键双击事件
Posted by bianbian on 2008-03-25 01:10
本文Tags: dblclick, IE, prototype, 右键
IE实在太垃圾了,再鄙视一次。。。鼠标右键双击居然没有。。。。
只好用onmouseup事件模拟一个(基于Prototype 1.6):
- if (Prototype.Browser.IE) {
- mouseCount = 0;
- Event.observe(document, 'mouseup', function(event) {
- if (Event.isRightClick(event)) {
- if (++mouseCount > 1) {
- mouseCount = 0;
- var pxy = Event.pointer(event);
- alert("right mouse double click on: " + pxy.x + ", " + pxy.y);
- } else {
- setTimeout("mouseCount = 0", 1000);
- }
- }
- });
- }
遵守创作共用协议,转载请链接形式注明来自http://bianbian.org 做人要厚道
相关日志
Posted in JavaScript, Technology | 1 Comment »