PixelsCommander / Propeller

JavaScript library to rotate elements with mouse or touch gestures. Supports inertia and stepwise rotation. Optimized for better performance.
http://pixelscommander.com/polygon/propeller/
409 stars 58 forks source link

what is the syntax for accessing the methods? #26

Closed nickcom closed 7 years ago

nickcom commented 8 years ago

sorry if this is obvious, but once I have initiated Propeller on a div, what is the way to access the stop method?

PixelsCommander commented 8 years ago

var propeller = new Propeller(div); propeller.stop();

2016-10-24 15:19 GMT+02:00 nickcom notifications@github.com:

sorry if this is obvious, but once I have initiated Propeller on a div, what is the way to access the stop method?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PixelsCommander/Propeller/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/AAxer9HaklJCLcsr_Zg1oRj303RuzPPNks5q3LBTgaJpZM4KexyZ .

nickcom commented 8 years ago

Thanks. But I'm using Propeller as a jquery plugin.

var $propeller = $('#div').propeller(options); $propeller.stop();

this doesn't stop the rotation.

nickcom commented 8 years ago

am I doing something wrong with the jQuery syntax?

PixelsCommander commented 8 years ago

Could you create a CodePen or JSBin with this?

nickcom commented 8 years ago

sure. Here is one:

https://jsfiddle.net/zxeodu6j/4/

Note the button doesn't stop the spin. I also noticed that the spinning will stop of its own accord (without button press) which I don't believe is expected behaviour?

PixelsCommander commented 7 years ago

When using jQuery you may access propellers with $.propeller.propellers which is an array of ones you created. To be honest I would not recommend to use jQuery syntax unless you need it for some solid reason.