select.options上的跨浏览器onmouseover [英] Cross-browser onmouseover on select.options

查看:84
本文介绍了select.options上的跨浏览器onmouseover的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


当鼠标移动到选择的各种选项时,我正在尝试显示不同的工具提示。我在基于Mozilla的浏览器中找到了一个灵巧的方法,但IE会对它进行扼杀。


任何帮助在IE中完成这项工作都会非常感激。


这是我找到的代码:

Hello,

I''m trying to make different tooltips appear as the mouse moves over the various options of a select. I found a slick method for doing so in mozilla-based browsers, but IE chokes on it.

Any help for making this work in IE would be very much appreciated.

Here''s the code I found:

展开 | 选择 | Wrap | 行号

推荐答案

请参阅此页面

谢谢,但不幸的是我的知识水平不够高,我可以从你的页面得到这个ference。


IE窒息的脚本部分是选择本身onmouseover中的事件参数,如下所示:


< SELECT ID =" aSelect"

ONMOUSEOVER =" showTooltip(this,event.target.value)"

ONMOUSEOUT =" hideTooltip();

>


显然IE不知道该如何处理。关于我如何解决这个问题的任何建议?


再次谢谢你,


jj
Thank you, but unfortunately my knowledge level is not high enough that I could get this from the page you reference.

The part of the script that IE is choking on is the event argument in the onmouseover on the select itself, shown here:

<SELECT ID="aSelect"
ONMOUSEOVER="showTooltip(this, event.target.value)"
ONMOUSEOUT="hideTooltip();"
>


Apparently IE doesn''t know what to do with that. Any suggestions on how I might work around that?

Thank you, again,

jj


阅读此部分。对于IE,您需要使用event.fromElement而不是relatedTarget(即W3C)。
Read from this part. For IE, you need to use event.fromElement instead of relatedTarget (which is W3C).


这篇关于select.options上的跨浏览器onmouseover的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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