fat / zoom.js

Medium's Image Zoom for jQuery
https://fat.github.io/zoom.js
MIT License
4.04k stars 332 forks source link

could you create an AngularJS version? #76

Open kmturley opened 8 years ago

kmturley commented 8 years ago

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/

dominickolbe commented 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'

kmturley commented 8 years ago

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 }" />