paulmak
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by paulmak
-
-
Hello,
Within a draggables snap "vars" you can pass the x and y values as "endValue" to a function for processing, how would you do this with other variables?
For example:TweenMax.to(target,1,{x:function(x){return x+10;}}); or something like TweenMax.to(target,1,{x:this.vars.x+10});
I'm aware you can use relative values such as "+=10", is there a way to pass the variable without referencing something like "target.position().left" (such for when "target" is an array)?
Thank you. -
Thank you for your suggestions, I've tried both but with no success. After playing around some more, I've simply implimented a global array[x,y] that onPress() would store the caller(x) and parent(y) and disable the parent[y], then onRelease() would cycle through the array[x][y] to match the caller with the [x] and enable the parent[y], afterwards slicing the array.
Made a codepen demonstrating this issue and my solution...See the Pen wGBNMx by anon (@anon) on CodePen
(drag the child red box out of the parent blue box)
Please do let me know if a better solution exists. -
Hello,
How would one disable an initial parent from dragging while dragging a child, if both are draggable. Upon dragging this specific child, it detaches from the parent in order to be ready for a new parent later ( during onDragStart), but both the old/initial parent and "child" are registered as actively dragging simultaneously. Is there a gsap variable for this?
Outside of this plugin(draggable) I would approach a similar issue by using a mouse event and seeing which element is on the top layer and allowing only that layer to do whatever changes.
I could disable the parent during the onPress event of the child if its parent is draggable, and then upon the onRelease of a child I could loop through all possible parents(might not have same parent anymore) and enable them (thus finding the one disabled). I don't think this is the proper solution though...Thanks in advance for any help!
Passing variable values to function
in GSAP
Posted
Thank you for the quick reply, i'm not sure if im explaining it well.
note: translating X is just being used as an example for simplicity, any property would be applicable.
The x would be different for each targetlist[number].