event.toElement在IE8和Firefox? [英] event.toElement in IE8 and Firefox?

查看:93
本文介绍了event.toElement在IE8和Firefox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经注意到,在Chrome和IE9中,对于onmouseout事件,有一个event.toElement属性(所以你可以确定鼠标现在指向的元素)。



我在Firefox或IE8中找不到可比的属性。



不幸的是,我不能使用jQuery来处理这些事件,我必须使用本机的js。 >

任何建议将不胜感激。

解决方案

在Firefox中,它是 event.relatedTarget https://开发人员。 mozilla.org/en/DOM:event.relatedTarget#1003983



事实证明,IE8有 event.toElement ,所以我不知道我在想什么...


I have noticed that in Chrome and IE9, for onmouseout events there is an event.toElement property (so you can determine which element the mouse is now pointing at).

I can not find a comparable property in Firefox or IE8.

Unfortunately I can not use jQuery to handle these events, I have to use native js.

Any advice would be appreciated.

解决方案

In Firefox it is event.relatedTarget https://developer.mozilla.org/en/DOM:event.relatedTarget#1003983

And it turns out IE8 does have event.toElement, so I'm not sure what I was thinking there...

这篇关于event.toElement在IE8和Firefox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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