]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects demo: Animate a containing div instead of the canvas directly for easing...
authorgnarf <gnarf@gnarf.net>
Tue, 8 Mar 2011 22:04:55 +0000 (16:04 -0600)
committerScott González <scott.gonzalez@gmail.com>
Wed, 9 Mar 2011 13:45:05 +0000 (08:45 -0500)
Canvas seems to be animating poorly in Chrome 11 - and animating the height only is scaling width too in some browsers yet not others...

demos/effect/easing.html

index d76957118964e8de532e922e6de0e34e7b40cd3b..0b6ba0885ab80fa4753b6671f3405ce2b6078525 100644 (file)
@@ -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,
@@ -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 );
                        });