Jump to content
Search Community

Draggable-Rater

istambolov 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

Hello there GreenSock masters!

 

I am trying to make a rater using angular components and a rater that the user caches with the mouse and starts to drag till he is reached for 1-10.

 

My current code i am using is very simple,  i have generate element that contains smaller elements from 1-10 and one rater square witch position is absolute 

but when i do the liveSnaps i stop being able to eaven move the element..... so please help me i can sent the project it contains only 1 element (rater ) :D so its not something big...

 
Draggable.create(".rater", {
bounds: document.getElementsByClassName("rater-container")[0],
type:"y",
liveSnap: {
y:[200,400,600]
}
});
 
Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

I added code similar to yours to a fork of one of @PointC's demos.

It appears to work just fine snapping to increments of 50px

 

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

 

Please do your best to provide a very basic example of what you are doing in an online, editable environment like CodePen, jsFiddle, plunkr, etc.

 

To edit the demo above:

 

  • click "Run Pen"
  • click "edit on CodePen
  • click "fork"
  • replace code in demo above with the least amount of code possible to illustrate the issue. if you can replicate the problem without Angular that would be fantastic.
  • save demo
  • send us the link

Hopefully once we can see your demo in an online environment that allows us to easily, view, test and share we will be able to provide some more assistance.

 

 

 

 

  • Like 5
Link to comment
Share on other sites

Hello again and thank you for the fast response!

 

Actually that example helped me allot so now i have different problem and its when the width of the element gets some kind of ugly number... 

U can see that the dragger is not reaching the end of the container.

 

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

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