Jump to content
Search Community

Draggable plugin - land on a different SVG section

Asya Smol 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

I have an SVG wheel with different locations, an arrow points to the default Las Vegas one (see attached), which I am using on a Las Vegas theme website. The thing is I want to re-use the wheel on another website, and the default location there is 'New Orleans'. Can I force SVG, through the draggable plugin, move to the 'New Orleans' section when a page is loaded? So instead of pointing to the default 'Las Vegas', it would be pointing to 'New Orleans'.

 

  Draggable.create("#wheelsvg", {
    type: "rotation",
    throwProps: true,
    dragClickables: true,
       snap:function(value) {
          return Math.round(value / 90) * 90;
        }
  });

 

 

151824116_ScreenShot2018-10-01at2_21_38PM.png.8bc55e473e5155d63c058e56da7cd2f4.png

Link to comment
Share on other sites

Thank you! So easy! I was thinking of adding a new class with an updated transform property to css (something like this: transform: matrix3d(0.7171, -0.69697, 0, 0, 0.69697, 0.7171, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1). And then adding that class to jquery. But I like your suggestion better. Thanks again.

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