-
6 Mar 2007 7:44 AM #1
Animation Direction
Animation Direction
I am using this function
cBox.setSize(imgSize.width,imgSize.height,true);
is there a way to tell the animation which direction to do.
What my problem is is that the box that expands that sits on the right side of the page will expand the window and cause to you have to scroll right to see it.
i basicly want to anchor it to the top right and have it expand out to the top left.
just select an item from the gird and add it to box 2 or 4 and then click on the box and you will see what i mean.
Thanks.
**edit** removed link.
-
6 Mar 2007 8:19 AM #2
Width has no "direction".
Really what you want is two concurrent animations.
Animate the left style attribute downwards, and the width upwards.
-
6 Mar 2007 9:36 AM #3
-
6 Mar 2007 11:15 AM #4
Hey Jon,
Just wanted to point out that using Element.slideOut/In, you can pass an anchor as a parameter to control exactly what you're trying to do. Check out the Fx class for details.
Brian
-
6 Mar 2007 12:06 PM #5
Thanks guys.
With some help from Jack I got this figured out.
Here is what i came up with when the box is clicked.
Code:var imgSize = Ext.fly(img[0]).getSize(); var xy = cBox.getXY(); if(cBox.hasClass('expanded')) { // we are expaned, do collapse if(cBox.hasClass('rightBox')) { cBox.setBounds(xy[0]+(imgSize.width-340),xy[1],342,152,{callback: function() { this.setStyle('position',''); this.removeClass('expanded'); }} ); } else { cBox.setBounds(xy[0],xy[1],342,152,{callback: function() { this.setStyle('position',''); this.removeClass('expanded'); }}); } } else { cBox.setStyle('position','absolute'); if(cBox.hasClass('rightBox')) { cBox.setBounds(xy[0]-(imgSize.width-340),xy[1],imgSize.width,imgSize.height,true); } else { cBox.setBounds(xy[0],xy[1],imgSize.width,imgSize.height,true); } cBox.addClass('expanded'); }
Similar Threads
-
grid direction problem
By efi in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 22 Nov 2007, 11:44 AM -
Side Effect with Animation v1.0a2
By mikegiddens in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 26 Feb 2007, 7:34 PM -
Animation/Fx
By brant in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 19 Feb 2007, 8:27 PM -
Sort direction and sort images
By dfenwick in forum Ext 1.x: BugsReplies: 3Last Post: 20 Sep 2006, 11:53 PM


Reply With Quote