Hi All
I'm working on a script for a dropdown menu. It's working fine so far, but I need to add one more thing and I can't figure it out. Here's the current script:
$j('ul.menu > li').hover(
function() { var ulHeight = $j('ul', this).height(); $j(this).children('ul').css({height: 0}).stop().animate({height: ulHeight}, 400); },
function() { $j(this).children('ul').stop().animate({height: 0}, 400); }
);
I need to to return the height of the UL to it's original size, and set the display to none, so it can run again. The way it is now, as the height is set to 0 on leaving, the next time the "ulHeight" is taken it's 0.
I tried it like this but no joy:
function() { $j(this).children('ul').stop().animate({height: 0}, 400).css({height: ulHeight}); }
Anyone any ideas?