Monday, March 26, 2012

Property animation in javascript.

How do i perform a property animation in javascript? the code below does not do anything... anything wrong?

offSet = 40;
controlSize = 19;
animation = new AjaxControlToolkit.Animation.PropertyAnimation(
panel,
0.25,
100,
'style',
'height');
animation.setValue(offSet + numOfControls*controlSize + "px");
animation.play();

Hi ,

Try setting the Width Property to "null" in the ReSize animation .

Ex :

//AjaxControlToolkit.Animation.ResizeAnimation.play(target, duration, fps, width, height, unit);

AjaxControlToolkit.Animation.ResizeAnimation.play( $get("ID") , 0.3 , 125 ,null , 500 ,"px" );

Hope this helps


HI,

I am assuming that resolved it .

Feel free to correct me .


Hey,

Another way to increase only the height .

AjaxControlToolkit.Animation.LengthAnimation.play(panel, 0.25, 50 ,

'style' ,'height', 100 , 400 ,'px');

This is better than the Resize animation with the width set to null.

No comments:

Post a Comment