More information about the Underscore mailing list

[_] jQuery animate() - stopping the queue

juan kennaugh contact at jkennaugh.co.uk
Fri Nov 21 12:27:42 GMT 2008

Hi

I tried binding and unbinding - but it wasn't getting around the time 
delay of the animation - so I looked into an easier way (by using 
'queue: false' parameter in the animate function).

like so:


<script>
    $(document).ready(function(){

        $("div.banner-promo p.link-more a").mouseover(function() {
            $(this).animate({
            paddingTop: "10px",
            paddingBottom: "10px"
            }, {queue: false, duration: 50});
        });

        $("div.banner-promo p.link-more a").mouseout(function() {
            $(this).animate({
            paddingTop: "5px",
            paddingBottom: "5px"
            }, {queue: false, duration: 50} );
        });

    });

 </script>





works fine


Juan






Adam Robertson wrote:
>> <script>
>>    $(document).ready(function(){
>>
>>        $("div.banner-promo p.link-more a").mouseover(function() {
>>            $(this).animate({
>>            paddingTop: "10px",
>>            paddingBottom: "10px"
>>            }, 100);
>>        });
>>
>>        $("div.banner-promo p.link-more a").mouseout(function() {
>>            $(this).animate({
>>            paddingTop: "5px",
>>            paddingBottom: "5px"
>>            }, 200);
>>        });
>>
>>    });
>>
>> </script>
>>
>>     
>
> Bind and unbind the function to the element
>
> http://docs.jquery.com/Events
>
>