Jump to content
GreenSock

BigMattKush

Stop child elements from rotating on Draggable.

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

Welcome to the forums, @BigMattKush. And thanks for being a Club GreenSock member!

 

The link you provided to the codepen appears to be invalid (404 error), so I'm not quite sure how to answer your question. Can you provide a valid link so we can see what's going on? 

Link to comment
Share on other sites

Soory Still a bit new to this forum, What can I provide? other than the embed link

 

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

Hi @GreenSock,

 

Great. Great fun! Chapeau!

 

Mikel

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Wow! This works beautifully! It helps a great deal. I am implementing for a an animation like this for a cake company. I will post to this thread when it publishes.

  • Like 2
Link to comment
Share on other sites

Project is still in development but here it is - - https://duffscakemix.zentropy.us/

 

It also takes nth number of images and calculates what to show. I have given the client the ability to load multiple images in the wordpress dashboard.

  • Like 2
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.
×