Open kmturley opened 8 years ago
sorry but your angular code is so bad
never use something like this:
el.css('transform', 'scale(1) translateX(0px) translateY(0px)');
do you know vendor prefixes? your code is not 'the angular way'
You don't need vendor prefixes to support transforms on current (and many previous) browsers: http://caniuse.com/#feat=transforms2d
The only improvement I would probably make is to put the css within the template itself e.g.
<img ng-style="{'transform': num, '-webkit-transform': num, '-ms-transform': num }" />
I've started an AngularJS directive, but it's not quite as smooth and springy as your version. Wondering if you would consider converting yours to work for AngularJS?
Here is my version for AngularJS https://jsfiddle.net/kmturley/ruwajt2e/6/