首页 > 编程 > JavaScript > 正文

Js event事件在IE、FF兼容性问题

2019-11-21 00:00:19
字体:
来源:转载
供稿:网友
1、window.event

IE:有window.event对象
FF:没有window.event对象。可以通过给函数的参数传递event对象。
如:
复制代码 代码如下:

<input type="button" onmousemove="showDiv(event);"//event不需要加引号
function showDiv(event)
{
var event=window.event||event;
event.clientX;
event.clientY;
}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表