Skip to content

Commit fa7f5d2

Browse files
gnarfscottgonzalez
authored andcommitted
Effects demo: Animate a containing div instead of the canvas directly 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...
1 parent 58480d8 commit fa7f5d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

demos/effect/easing.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
}
3434
var graph = $( "<div/>" ).addClass( "graph" ).appendTo( "#graphs" ),
3535
text = $( "<div/>" ).text( ++i + ". " + name ).appendTo( graph ),
36-
canvas = $( "<canvas/>" ).appendTo( graph )[ 0 ];
36+
wrap = $( "<div/>" ).appendTo( graph ).css( 'overflow', 'hidden' ),
37+
canvas = $( "<canvas/>" ).appendTo( wrap )[ 0 ];
3738
canvas.width = width;
3839
canvas.height = height;
3940
var drawHeight = height * 0.8,
@@ -78,9 +79,9 @@
7879
});
7980
ctx.stroke();
8081
graph.click(function() {
81-
$( canvas )
82+
wrap
8283
.animate( { height: "hide" }, 2000, name )
83-
.animate( { left: 0 }, 800 )
84+
.delay( 800 )
8485
.animate( { height: "show" }, 2000, name );
8586
});
8687

0 commit comments

Comments
 (0)