Jump to content
GreenSock

xpo_greensock@knorex.com

TweenMax.set is setting wrong position

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi Guys, first Time, when i clicked on greenbox, it show correct position, But when i move it to another position then clicked it again. it show wrong position. 

pls help me to figure out..

987607439_ScreenShot2018-06-23at9_19_01PM.png.31a8a526da6e00843bb2daea2c71fbdd.png1993362701_gsaperror.thumb.gif.f10b9736d4bd35d521c3d09c6507dca5.gif

Link to comment
Share on other sites

Hi xpo_greensock@knor,

 

It will be hard to troubleshoot without having the whole context in which the code is operating. Could you setup a simple demo in CodePen or JsFiddle? Or somewhere else that we are able to see the live code?

 

Having said that, if all you want is a border around the selected element, wouldn't it be simpler to just have a border set with a transparent color and then, on selection, you toggle the color to full black?

Link to comment
Share on other sites

Yeah, it's tough to troubleshoot blind but I bet you've got the move (Draggable?) altering the transforms (x/y or translate()) whereas you're basing the highlight's position on top/left which are totally different. Transforms don't affect top/left at all. The browser still reports them based on where the element is in the document flow, but transforms don't affect flow at all. Once we see a codepen demo, I'm sure it'll become clear. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×