-
4 May 2012 10:48 AM #1
Unanswered: Animating a floating component don't work - slide down / slide up animation type
Unanswered: Animating a floating component don't work - slide down / slide up animation type
Hi,
I have a problem with a floating component that I want to animate.
The floating component is an item creates in my viewport. It contains an image tag in html and it is at a -62px top position because I don't want to see it at first.
There is the code of the component:
When I click on a button in the current panel in the viewport, I want to show the floating panel with a slide down animation.Code:{ top: -62, width: 167, height: 62, id: 'pointsTabItem', cls: 'pointsTab', html: '<img id="pointsTab" src="images/ongletPoints.png"/>', },
The code for the show animation work well :
When I click on another button in the viewport, I want to hide the floating panel with a slide up effect.Code:var anim = { duration: 500, direction: 'down', easing: 'ease-in', autoClear: false, from: { top: '-62px', }, to: { top: '0px' } } Ext.Anim.run(Ext.get("pointsTabItem"), 'slide', anim);
I tried to change the value of the animation object, the panel is hiding but without any animation. I also try just to use a completely different object like the following one, and it also change nothing:
So I finally tried the hide animation without doing the show animation before and it work great. So it look like the problem is when the component has been animate and I try to change the animation property and run the animation again it won’t work.Code:var anim2 = { duration: 500, direction: 'up', easing: 'ease-in', autoClear: false, from: { top: '0px', }, to: { top: '-62px' }, before: function(el) { console.log("before anim"); }, after:function(el) { console.log("after anim"); } Ext.Anim.run(Ext.get("pointsTabItem"), 'slide', anim);
Does somebody has experience the same problem and find a solution?
Thank you
-
6 May 2012 3:56 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3161
Have you tried the showAnimation/hideAnimation configs?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
6 Jun 2012 7:12 PM #3
I've had this problem too, tried the showAnimation and hideAnimation configs but while slide left/right work, up/down never work for a floating panel.
-
15 Jun 2012 1:21 PM #4
I'm having the same problem with slide. I tried flip and fade and they worked fine. Here's the approach I am using:
XTemplate:
Code:... '<span class="delete-button" style="float:right;" ></span>', ...
Controller:
Code:button = Ext.create('Ext.Button', { ui: 'decline-small', text: 'Delete', hidden: true, showAnimation: { type: 'slide', direction: 'left', duration: 1000, } }); if (!target.down(".x-button")) { button.on('tap', function(button) { // Remove the list item button.destroy(); list.getStore().removeAt(index); // Remove the bill from the database this.onDeleteBill(record); }, this); button.renderTo(target.down(".delete-button")); button.show(); }
Any suggestions would be greatly appreciated.
-
16 Nov 2012 7:56 AM #5
I still have this problem too, I've tried everything suggested here and lots of other stuff and only the exit animation works.


Reply With Quote