Giter Club home page Giter Club logo

angular-pinch-zoom's Introduction

angular-pinch-zoom

angular-pinch-zoom can easily zoom image by pinch gesture for AngularJS.

Demo

Usage

Module Name

  • ngPinchZoom

Directive

  • ng-pinch-zoom

Example

  • Static Image:
<img src=“image.jpg” width=“320” height=“320” alt=“” ng-pinch-zoom max-scale=“4”>
  • Angular Supplied Image $scope.image
<img ng-src=“{{image}}” width=“320” height=“320” alt=“” ng-pinch-zoom max-scale=“4”>

max-scale is optional. (default: 3)

Support

AngularJS

  • 1.2.x +

Devices

  • Android 4.x +
  • iOS 5.x +

License

The MIT License (MIT)

angular-pinch-zoom's People

Contributors

cwperry avatar ktknest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

angular-pinch-zoom's Issues

Second pinch shifts the image and renders it useless

we are using this at my organization, cool directive, but we found an issue with it:

when you pinch and zoom then remove your fingers from the screen, then go back to pinch and zoom again on the already zoomed in frame, the image shifts wildly off the screen and the experience craps out. is this a known issue?

the specific scenario it happens in is this: we have a photo viewing modal that displays pics in a vertically cascading list. you can click or press one pic to bring it into isolate view. ng-pinch-zoom is on the tag for this isolate view so the user can pinch and zoom the isolate image but not the previous list view. we use your directive because it allows us to maintain the X button while pinching and zooming the image, so we have the X button to escape the shifted, buggy view, but would still like to avoid that experience if possible.

Full Screen / Pinch Zoom

Hi,

Is it possible to have CSS/markup so that I can open the picture full screen preserving aspect ratio and still having the pinch-zoom, pan functionality?

When I specify width/height/max-width/max-height in % it seems to break the functionality causing other element to move around and sometimes the pan is not working...

Thanks!

image is not resetting

I am using this directive for my application which has multiple images for one product. It's working really fine otherwise except, when i zoom into image 1 and then i touch on next image ( image 2), image 2 is also showing at the zoomed scale. Is there a way that after touch event end on image 1, clicking ( touching) on image 2 will reset the view and it will show whole image instead of zoomed image 2? Any help would be appreciated. Thanks

images different from device orientation does not zoom correctly

first of all thanks for the cool directive but there is an issue with it where if I zoom in a landscape image in portrait device then it does not zoom correctly but works fine with landscape view and the same happens with portrait image in landscape view

Lazy load support

I already used a lazy load plugin. But it didn't work with pinch-zoom. I also change my lazy load plugin, but still the same problem. Will there any support for image lazy loading?

needed to change evt.touches to evt.originalEvent.touches throughout

I'm not sure exactly why, but I was getting errors using this that amounted to evt.touches being undefined. I found advice elsewhere (e.g., here http://stackoverflow.com/questions/6173382/cant-able-to-get-the-properties-of-touchstart-event) that JQuery doesn't bring the touches array to its event object and that you need to access it through originalEvent. Seems odd since you don't seem to be invoking JQuery. The app I'm using it in does, so maybe there was conflict somehow (?). Changing all instances of evt.touches to evt.originalEvent.touches did get the directive working for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.