This looks like pretty straight forward navigation menus. You might
want to consider looking into already existing menu implementations
instead of rolling your own.

I'm not sure why the links are disappearing, but I have some other
suggestions, any of which might help clean up strange behavior.

You don't need to have those 3 nulls in there. The last parameter to
animate is optional, and can safely be omitted entirely, and that null
in the second hover function isn't doing anything useful there.

Using attr("class") to get a specific class is a dangerous game since
the element in question could have more than one class assigned to it.

The for loop could be replaced by:
$('#Menu .MenuDropDown').each(function() {
 var dropdown = this;
 // everything you had goes here
});

You can do $(dropdown).is(':visible') to test for visibility instead
of dropdown.style.display == 'block'/'none'.

The long line that sets the css property 'left' could be replaced with
$(dropdown).css('left', ...). And the big calculation might clean up a
bit by making use of the dimensions plugin.

Setting the 'display' property to 'block' is taken care of for you by
animating the opacity. You don't need to do it manually.

The various opacity animations could be replaced with fadeIn, fadeOut,
and fadeTo.

Good luck with it.

--Erik

On 6/4/07, Tatham Oddie <[EMAIL PROTECTED]> wrote:

Hi guys,

I've built out this page here:

http://testdrive.squeezecreative.com.au/eastgate/

It's working perfectly in IE6, IE7 and FF2/PC however broken badly in
Safari 2.0.4 and slightly broken in FF2/Mac. My main priority is
Safari right now.

As you move the mouse over the sub menu, triggering the links to fade
in and out, the links start to randomly disappear!

Can anybody helps shed some light on this?


Thanks in advance,

Tatham Oddie
New to jQuery


Reply via email to