Dave...

First of all, thank you for checking out my code. Second, you just answered
a question that I've had since I started using jQuery, namely why does the
animation queue up endlessly, or keep going after my mouse moves out.

I assume that all you have to do is to add in the .stop() method to
accomplish that?


andy

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Methvin
Sent: Monday, December 08, 2008 7:00 PM
To: jQuery (English)
Subject: [jQuery] Re: Making a UL simulate an option box?


I noticed that the page didn't work right with IE and also didn't stop the
animation if you did mouseover/out quickly. This version works a bit better:

        var $cont = $('#scrollMe');
        var parentHeight = $cont.height();
        var childHeight = $cont.find('li:first').height();
        $cont.height(childHeight);
        $cont.hover(function(){
                $cont.stop().animate({
                        height: parentHeight
                },'slow');
        },function(){
                $cont.stop().animate({
                        height: childHeight
                },'slow');
        });


Reply via email to