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

how to rotate by javascript? #17

Closed mike8625 closed 8 years ago

mike8625 commented 8 years ago
  1. rotate by js 2.when init, i use new Propeller(document.getElementById('r'), { angle: 45, ... i want to rotate by animation, and onRoate event can fired.
PixelsCommander commented 8 years ago

It is pretty hard to understand what you are aiming for Try var prop = new Propeller(node); prop.angle = 45

mike8625 commented 8 years ago

sorry, my English is bad. var prop = new Propeller(node); prop.angle = 45; it can work but it has no animation; prop.angle = 45; ----> 0 -> 45; i want: 0->1-2-> 3-->4->....->45...... just like css keyframes xxx 0%{transform: ratate(0)} 100%{tranform: rotate(45)};

PixelsCommander commented 8 years ago

use tween.js for smooth changing https://github.com/tweenjs/tween.js/