Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Hector Haralambous

The canvas coordinates of randomly placed composition CSS elements

Recommended Posts

Hey @Hector Haralambous,


Welcome to the GreenSock Forum.


Here an example to get the position of an element relative to the document / to the parent (see console).


Overlapping: This requires complex logic. Here is an example of how Draggable hitTest is used

(no way to get pixel-perfect hit testing for non-rectangular shapes): drag the blue (only this one!).


See the Pen 10150b34fdfd81f1e314f57355d7990d?editors=1010 by mikeK (@mikeK) on CodePen


Happy tweening ...




  • Like 3
Link to post
Share on other sites

Thank you very much Mikel,

Your reply is precisely what I wanted. I am going to extend the functions do that they apply onto an array of my compositions elements. 





  • Like 1
Link to post
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.