我有一个简单的 select
标签
I have a simple select
tag
<select>
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
</select>
我想在 option
$('select option').hover(function(){
console.log($(this).val());
},function(){
console.log("mouse out");
});
但是,它仅适用于 Firefox,不适用于 Chrome.我怎么解决这个问题?它是jquery中的错误吗?有什么技巧吗?
However, it only works in Firefox, not in Chrome. How can I solve this problem? Is it a bug in jquery? Is there some hack?
hover 事件不会在 Chrome 和 IE 中触发选项元素,可能在其他浏览器中也是如此.您可以尝试为此使用一些自定义脚本:http://peterned.home.xs4all.nl/csshover.html
hover event will not fire for option elements in Chrome and IE, might be in other browsers as well. You could try using some custom script for that: http://peterned.home.xs4all.nl/csshover.html