Skip to content

Commit

Permalink
Effects demo: Animate a containing div instead of the canvas directly…
Browse files Browse the repository at this point in the history
… for easing demo. Fixes #7086 - easing only first click is working.

Canvas seems to be animating poorly in Chrome 11 - and animating the height only is scaling width too in some browsers yet not others...
(cherry picked from commit fa7f5d2)
  • Loading branch information
gnarf authored and scottgonzalez committed Mar 9, 2011
1 parent a067dfa commit 6bd5c08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions demos/effect/easing.html
Expand Up @@ -33,7 +33,8 @@
}
var graph = $( "<div/>" ).addClass( "graph" ).appendTo( "#graphs" ),
text = $( "<div/>" ).text( ++i + ". " + name ).appendTo( graph ),
canvas = $( "<canvas/>" ).appendTo( graph )[ 0 ];
wrap = $( "<div/>" ).appendTo( graph ).css( 'overflow', 'hidden' ),
canvas = $( "<canvas/>" ).appendTo( wrap )[ 0 ];
canvas.width = width;
canvas.height = height;
var drawHeight = height * 0.8,
Expand Down Expand Up @@ -78,9 +79,9 @@
});
ctx.stroke();
graph.click(function() {
$( canvas )
wrap
.animate( { height: "hide" }, 2000, name )
.animate( { left: 0 }, 800 )
.delay( 800 )
.animate( { height: "show" }, 2000, name );
});

Expand Down

0 comments on commit 6bd5c08

Please sign in to comment.