Jump to content
Search Community

Assign text to many rectangles using drag and drop and cloning the text

max123 test
Moderator Tag

Recommended Posts

The problem is that when you're working with SVG, there's no such thing as z-index to make things appear on top of others. You have to literally append the element so that it's the last element in the children of the <svg>. In other words, it's completely dependent on the order in the DOM. 

 

You also had some faulty logic in your loop but I assume you wanted something like this: 

See the Pen NWzvMRV?editors=1010 by GreenSock (@GreenSock) on CodePen

 

I don't have time to dig into what you're trying to do with all those .children() calls inside your hitTest() - I'd bet that a ton of that could be greatly simplified but we just don't have the resources here to provide free general consulting services for logic issues. Same goes for your cloning stuff. We're happy to answer any GSAP-specific questions, though. 

 

Good luck!

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...