PDA

View Full Version : Annimation of setting style doesn't work?



paladinjack
15 May 2009, 7:54 AM
This part in the manual is not working :(

// animate the transition of color
Ext.fly('elId').setStyle('color', '#FFFFFF', true);

instead of color animation, the outcome is the same if you set either true or false
besides, it was not shown up in the documentation that the setstyle can be animated.
somebody got an idea?

tested under firefox

Animal
16 May 2009, 12:23 AM
Errr... which documentation are you reading?

paladinjack
25 May 2009, 10:11 AM
The Ext 3.0 core manual(on the homepage), where in the examples a animation parameter can be added to setStyle

Animal
25 May 2009, 9:46 PM
Why don't people use the API docs?

http://extjs.com/deploy/ext-3.0-rc1.1/docs/?class=Ext.Element&member=setStyle

paladinjack
5 Jun 2009, 9:02 AM
Animal:
Thanks. I started in Ext 1.x and to the best of my knowledge i don't think the setStyle function ever supported animation.
However, in the Ext core 3.0 manual there are following examples:

setStyle
Set style properties on an element. Takes a string or an object literal.
Ext.fly('elId').setStyle('color', '#FFFFFF');
Ext.fly('elId').setStyle('z-index', 10);
Ext.fly('elId').setStyle({
display : 'block',
overflow : 'hidden',
cursor : 'pointer'
});
// animate the transition of color
Ext.fly('elId').setStyle('color', '#FFFFFF', true);
// animate the transition of color with a duration of .75 seconds
Ext.fly('elId').setStyle('color', '#FFFFFF', {duration: .75});
// ... etc.

And it seems that by supplying an animation config we can retrieve a style transition.
I see it's not provided in the api, but i thought i could be a cryptic config, so i tried, and obviously not working in FF3

If it is not supported, i think it should be removed from the manual. Could be misleading.

Animal
5 Jun 2009, 10:44 AM
Yes, someone's made a mistake in authoring that document!