Ticket #6362 (new defect)
Event: onmouseenter and onmouseleave support bug?
| Reported by: | guest | Owned by: | anonymous |
|---|---|---|---|
| Priority: | normal | Milestone: | future |
| Component: | General | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: | ole.ersoy@… |
Description
Hi,
I hooked up a "fading" event handlers for onmouseenter and onmouseleave on a div element element in firefox 2.0. I'm expecting the element, and all child elements to fadeIn when the when onmouseenter is fired, and fade out when onmouseleave is fired.
The result is mixed, depending on what angle the mouse enters and leaves from. I think that means there's a bug, unless I misunderstood onmouseenter and onmouseleave, as written up here:
http://www.quirksmode.org/js/events_mouse.html
Here's the test that shows this:
<script type="text/javascript">
dojo.require("doh.runner");
dojo.addOnLoad(function() {
doh.register("Tests",
[
{
setUp: function() { }, name: "Test OnMouseEnter? And Leave", runTest: function() {
var handleMouseLeaveEvent = function(mouseLeaveEvent) {
var node = mouseLeaveEvent.target;
dojo._fade( {
node: node, duration: 500, end: 0.6
}).play(5); mouseLeaveEvent.stopPropagation();
}
var handleMouseEnterEvent = function(mouseEnterEvent) {
var node = mouseEnterEvent.target;
dojo._fade( {
node: node, duration: 500, end: 1
}).play(5);
mouseEnterEvent.stopPropagation();
}
dojo.connect(dojo.byId('item4'),
'onmouseenter', handleMouseEnterEvent);
dojo.connect(dojo.byId('item4'),
'onmouseleave', handleMouseLeaveEvent);
}
},
]
); doh.run();
});
</script>
</head> <body id="body">
<div id="item4"
style="opacity: 0.5"> This should fade in <p>And this should fade In Too <i>together with this</i> and this, and we should all fade out at the same time</p>
</div>
</body> </html>
As can be seen the fading behavior is different depending on where the mouse enters and leaves. I think it's supposed to be the same. Another interesting thing is that if the div element is setup like this:
<div id="item4"
style="opacity: 0.5"> This should fade in <p>And this should fade In Too <i>together with this</i> and this, and we should all fade out at the same time</p> And if I add some more text outside of the paragraph element, this is true.
</div>
The test works as expected...except for when the cursor exits the node area to the right...
Thoughts?
Cheers, - Ole