In my experience I've had success using two different mouseover events
instead of a mouseover/mouseout combination.
The first mouseover observer is a simple one:
$('nav').observe('mouseover', function(event) {
$('nav').show();
});
The second observer observes the entire document and checks to see if
$('nav') is found by Event:findElement. If it's not found hide the nav.
document.observe('mouseover', function(event) {
if (!event.findElement('#nav')) $('nav').hide();
});
This has worked for me in IE and FF but I think cross-browser mouseleave /
mouseenter could be better.
-Hector
On Thu, Oct 2, 2008 at 8:14 AM, Walter Lee Davis <[EMAIL PROTECTED]> wrote:
>
> This is the same problem we are talking about in at least two other
> threads. If you set a mouseout listener on a DIV, that event will
> fire as soon as you mouse over one of that DIV's children. Because,
> you know, technically you are no longer over the parent DIV, you are
> over the child.
>
> IE has a very useful event called mousenter/mouseleave which deals
> with this in an elegant manner. But it's not available in other
> browsers. There are several different approaches circling around to
> fixing this. Nick Stakenburg has a patch which adds this to the
> Element.observe at the core level, so you can use it on any browser.
> There's another approach (multiple authors) that uses custom events,
> but it's been pooh-poohed as being a browser hog.
>
> Where you go from here is something I would like to know myself. I'd
> like to add this behavior with an extension rather than a patch, or I
> suppose I could wait until it gets added to core. Mouseovers are a
> right pain without this!
>
> Walter
>
> On Oct 2, 2008, at 9:39 AM, [EMAIL PROTECTED] wrote:
>
> > if i go over the home button the menu shows, but when im going into my
> > menu to click on a link my menu closes :S
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---