Alex Rivera | Logout

jQuery Pause / Resume animate

Asked 2011-04-07T18:52:50.343
13

This ain't working for me...

$(document).ready(function(){
    $('#h .a').animate({
        top:'-=80px'
    },90,'linear');

    $('#h .au,#h .di').animate({
        left:'-=80px'
    },50000000,'linear');

    $('#h .r').animate({
        left:'-=80px'
    },250,'linear');

    $("#h").animate('pause'); //pausing it at the start
    //resume pause switch
    $("#h").mouseover(function(){
      $(this).animate('resume');
    }).mouseout(function(){
      $(this).animate('pause');
    });

});
Edit
Report

1 Answer

1

You'll want to look into using the .stop() function for this, as it'll stop any animations on a jQuery element.

http://api.jquery.com/stop/

answered 2011-04-07T19:01:13.780

Your Answer