Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
elandril

Rotating and deleting draggable objects

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

So, I was trying to implement Fancy's rotation approach found here: 

See the Pen doPLME by MAW (@MAW) on CodePen

. But, it only every applies to one object. How can I get all objects to rotate when a user selects that object and pulls it around, if that makes sense? Also, I've been having trouble deleting an object and thought something Draggable.disable() or something would work but doesn't seem to. Thanks for your help - I'm a total newb to greensock so its much appreciated!

See the Pen PqKaEW by anon (@anon) on CodePen

Link to comment
Share on other sites

How can I get all objects to rotate when a user selects that object and pulls it around, if that makes sense? 

 

 

Sorry, I'm a bit lost. The demo you referenced is a great example of allowing an object to be dragged and rotated I'm not really sure what more we can do to help with that. I imagine you could apply the same effect to multiple objects using a loop, but we really have to focus on supporting features of the GSAP / Draggable API, and can't get too deep into advanced implementations.

 

For deleting a DOM element you will probably find jQuery's remove() function very helpful and easy to use: https://api.jquery.com/remove/

  • Like 2
Link to comment
Share on other sites

Hi elandril  :)

 

Carl is right , but just in addition , yep , you  just need a loop ( jquery .each() or a js for loop ) , i think this can help you :

 

See the Pen LVZZeG by MAW (@MAW) on CodePen

  • Like 1
Link to comment
Share on other sites

Thanks guys I'll take a look at that and will apply a loop to it!

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