Making events fire in iE6 while <select> is active and dropped down
I am pretty sure this is just a limitation of iE6, but I thought I better ask just incase:
<body>
<h1>Select + event test</h1>
<div>
<select>
<option>ABC</option>
<option>123</option>
</select>
<span id="eventSrc">Event Source</span>
</div>
<div id="log"></div>
<script type="text/javascript">
var log = $("#log");
$("#eventSrc").bind("mouseover mouseout mouseenter mouseleave", function(event){
log.append(event.type + "<br/>");
})
</script>
</body>
In all modern browsers, the log registers mouse* events, even when the select is "dropped down". In iE6, it doesn't seem to fire the events while active + dropped down.
Any solutions? My usecase is for tooltips that need to popup on mouseover, ev开发者_如何学编程en when looking at the dropdown list..
Pure JS solutions also welcome, jQuery is just concise for my demo :)
I think you are out of luck. IE has notoriously had issues with select lists.
e.g. you can't bind events to the options in a select list... or disable them (pre IE8) and trying to modify the contents (e.g. options) while it is open fails.
精彩评论