Jump to content
Search Community

Stop child elements from rotating on Draggable.

BigMattKush 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

Hi, I am working with throwprops plugin maybe you can help. I was refrencing the following

 

 

Is there a way to make this work on drag using draggable. Essentailly I do not want the child elements to rotate.

 

I would not want any child element to rotate, no matter the position.

 

Check out my prototype here

 

 

Trying to make it work with this. I also need to show a different image every so many degrees based upon how many images are loaded. but that is an other story

 

See the Pen qwwovj by Kirshman (@Kirshman) on CodePen

Link to comment
Share on other sites

Alright, this was a fun challenge, so I forked your codepen and created this: 

See the Pen LomEvN?editors=0010 by GreenSock (@GreenSock) on CodePen

 

If I understood your goal, it covers all the bases. I wrote a function for you that you can just feed an array of URLs into and it'll distribute them around the edge of the circle evenly, and counter-rotate them. I wired up the Draggable so that its rotation simply updates the main timeline that's doing the circle and image rotations, so it's very performant (no need to keep re-creating tweens or setting new values each time). I even made the original spin resume after the throw completes, but it gradually speeds up to normal over the course of a second (so that it wasn't jarring). 

 

Fun!

 

Does that help? 

  • Like 3
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...