Jump to content
Search Community

Draggable instance in a custom class, in CodePen

st3f test
Moderator Tag

Recommended Posts

Hi guys,

about what we where saying these days with @Rick May @GreenSock @ZachSaucier and the super-kind @OSUblake, it's really difficult to talk about the difficulties I am having with the new Draggable if some simple code working on virtual servers, production servers and online, is not working on CodePen...

Unless I added some extra ";" or I copied some whatever classes :)

 

And, clearly, the problem is not to intercept an onClick, but working with parametric ids in a more complex machine.

 

Thank you for any help

See the Pen QWWXxGW by st3f (@st3f) on CodePen

Link to comment
Share on other sites

Draggable has no problem working with classes. In fact, that's usually how I make draggable stuff. The person in that other thread didn't provide an example, so I don't know what their issue was. I can say with 100% certainty that the problem is not classes.

 

There is no onStartDrag callback. It's onDragStart. And to call a method, you need to use this

 

// bad
changeContentText("Hey"); // not working...

// good
this.changeContentText("Hey"); // working...

 

See the Pen a921cd0166788cdfbecb66c9f29c5267 by osublake (@osublake) on CodePen

 

 

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