Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jquery/jquery
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: jpmitche11/jquery
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 31, 2011

  1. Fixing bug in jquery animation loop. If the stop() method is called i…

    …nside of
    
    another animation's callback, then that element's state becomes inconsisten. Any animations later applied to that element may not run.
    Here is a sample of code that will demonstrate the issue:
    $(document.body).html("<div id='content'></div>");
    var $el = $("#content");
    $el.css({height:'100px', width:'100px', 'background-color':'red', margin: '250px'});
    
    $el.animate({height: "+=100"}, 1000, function(){
        $el.stop();
    
        //this animation is dropped
        $el.animate({width: "+=100"}, 1000, function(){
            console.log("will not run");
    
        }).animate({"margin-left": "+=100"}, 1000, function(){
            console.log("this wont run either, until the element's state is fixed");
    
        });
    
    }).animate({height: "-=100"}); //this animation will be stopped
    
    setTimeout(function(){
        //when this runs the element's state will be corrected
        //and the dead animations will resume
        $el.stop();
    }, 5000);
    Patrick Mitchell committed Mar 31, 2011
    Configuration menu
    Copy the full SHA
    de8b58f View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2011

  1. adding testcase to demonstrate previous stop() bug

    Patrick Mitchell committed Apr 4, 2011
    Configuration menu
    Copy the full SHA
    8921818 View commit details
    Browse the repository at this point in the history
Loading