Jump to content
Search Community

Keep children inside parent container

markilfin test
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

And you also want to factor in the rounded corners?

Nope, not necessary. Can be rectangle.

No problems. Probably, I'll solve this issue myself tomorrow. Just thought that maybe a good idea will come to someone while i'm in bed. Or maybe someone had the same problem and already has a solution.

 

PS sorry for my bad english. i'm from Moldova.

Link to comment
Share on other sites

Instead of using the jQuery position() method to get left and top offset.

 

Try using getBoundingClientRect instead:

 

https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect

 

And getClientRects

 

https://developer.mozilla.org/en-US/docs/Web/API/Element/getClientRects

 

This way you can get more accurate offsets of its position.

 

:)

  • Like 1
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.
×
×
  • Create New...