-
2 Jan 2013 6:25 AM #1
Answered: controlling slide animation
Answered: controlling slide animation
Hi,
I'm trying to create a slide animation for a panel using :
I do get the defined animation but the values 'from' and 'to' are ignored.Code:Ext.Anim.run(this, 'slide', { direction: 'right', from: {left: 100}, to: {left: 200}, after: function() {this.setLeft(200);} });
The animation always runs from the element's origin to the (Origin + element width).
What am I doing wrong here ?
Is there a way to make is stay at the 'to' position (it is jumping back to it's origin) ?
Thanks
Erez
-
Best Answer Posted by ehboym
Finally I have a working pice of code:
I'm not shore what made the difference but it is working now.Code:Ext.Animator.run({ element: LMapcontrol.element, easing: 'ease-in', preserveEndState: true, from: {left: -62}, to: {left: 0} });
Erez
-
2 Jan 2013 6:32 AM #2
You forgot to append 'px', and, probably, to slide your panel you should run your animation to the panel element and the direction config is not needed.
PS: Be sure your panel is floating or that it has an absolute positioning.Code:new Ext.Anim.run(this.element, { from: { left: 100 + 'px' }, to: { left: 200 + 'px' } });Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
2 Jan 2013 6:57 AM #3
Hi,
The objet is animated from 0px to LMapcontrol.width ignoring the 'from' and 'to' values.Code:var LMapcontrol = Ext.getCmp('viewMapControls_L'); Ext.Anim.run(LMapcontrol, 'slide', { direction: 'right', from: {left: 100 + 'px'}, to: {left: 200 + 'px'}, after: function() {LMapcontrol.setLeft(0);} });
The panels top and left parameters are set so it should be floating.
and without the 'after function it jumps to it's starting position.
Erez
-
2 Jan 2013 10:49 AM #4
Finally I have a working pice of code:
I'm not shore what made the difference but it is working now.Code:Ext.Animator.run({ element: LMapcontrol.element, easing: 'ease-in', preserveEndState: true, from: {left: -62}, to: {left: 0} });
Erez


Reply With Quote