I have this codex, that works with jquery e rapahel_jquery. It's a function with some mouseevents. Problem with mouseout for IE and Opera. This is extrapolate from the codex:
for (var province in ita)
{
(function (prov, province)
{
开发者_如何学JAVA prov.color = Raphael.getColor();
prov.scale(2.5, 2.5);
}); //close mouseover
prov.mouseout(function()
{
alert('ciao');
prov.scale(1, 1);
}); //close mouseout
prov.mousedown(function()
{
dialog($alfa); // calling the function dialog
}); //close mousedown
}); //close function (prov, province)
}
All works, but not prov.mouseout with IE e Opera!!! why?? Can you help me??
Thanks!
you are using jQuery? Try mouseleave instead of mouseout.
mouseleave is an IE-only javascript event. Now, jQuery's interpretation of mouseleave works slightly different than their version of mouseout.
jQuery mouseleave is triggered when the mouse goes outside of the element it is tied to.
jQuery mouseout is triggered when the mouse goes outside of the element it is tied to, or also when the mouse goes outside any of that element's descendent elements.
I don't see why you would ever want to detect mouseout of descendant elements, so this is the reason why I use jQuery mouseleave for everything and never bother with mouseout.
Also, maybe this jquery e rapahel_jquery library uses an older version of jQuery, and if you were able to use a newer version maybe this Opera/IE bug would have since been corrected? I would still try mouseleave because (as far as I can tell without looking in to the jQuery source) it uses entirely different functionality to accomplish a similar type of action and it was intended on replicating an IE-only event.
精彩评论