mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
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...
(cherry picked from commit fa7f5d2873
)
This commit is contained in:
parent
a067dfa8a2
commit
6bd5c08a1d
@ -33,7 +33,8 @@
|
|||||||
}
|
}
|
||||||
var graph = $( "<div/>" ).addClass( "graph" ).appendTo( "#graphs" ),
|
var graph = $( "<div/>" ).addClass( "graph" ).appendTo( "#graphs" ),
|
||||||
text = $( "<div/>" ).text( ++i + ". " + name ).appendTo( graph ),
|
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.width = width;
|
||||||
canvas.height = height;
|
canvas.height = height;
|
||||||
var drawHeight = height * 0.8,
|
var drawHeight = height * 0.8,
|
||||||
@ -78,9 +79,9 @@
|
|||||||
});
|
});
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
graph.click(function() {
|
graph.click(function() {
|
||||||
$( canvas )
|
wrap
|
||||||
.animate( { height: "hide" }, 2000, name )
|
.animate( { height: "hide" }, 2000, name )
|
||||||
.animate( { left: 0 }, 800 )
|
.delay( 800 )
|
||||||
.animate( { height: "show" }, 2000, name );
|
.animate( { height: "show" }, 2000, name );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user