From fcf954a0297b0b1c17f29be688962c0224b180f8 Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 16 Mar 2017 11:55:06 +0100 Subject: [PATCH 1/3] Reworked - updated to JQuery 1.7+ - add moveToAndScale function - remove chrome passive listener warning - fix resize bug if u use 100% size and bootstrap - Tested on Desktop Chrome, Edge and Firefox - Android Chrome and Android 5.2 Browser - Firefox 52: Hybrid devices dont detect touch event - Edge need property about:flags touch enable --- README.md | 24 ++- example/index.html | 2 +- src/e-smart-zoom-jquery.js | 267 ++++++++++++++++++++++++--------- src/e-smart-zoom-jquery.min.js | 2 +- src/jquery-1.11.0.min.js | 4 - src/jquery-2.2.1.min.js | 4 + 6 files changed, 229 insertions(+), 74 deletions(-) delete mode 100644 src/jquery-1.11.0.min.js create mode 100644 src/jquery-2.2.1.min.js diff --git a/README.md b/README.md index 4716172..5ece572 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,14 @@ This plugin manage smooth zoom and pan on a given dom element. The plugin works Zoom is enabled via mouse events (scroll and click) on pc and with touch events on mobile devices. -For live examples and more explanations visit : [http://e-smartdev.com/#!jsPluginList/panAndZoomJQuery](http://e-smartdev.com/#!jsPluginList/panAndZoomJQuery) +Tested on: +- Chrome 56 +- Firefox 52 +- Edge + +Some browser dont support touch event or need special flags watche here: http://caniuse.com/#search=touch + +For live examples and more explanations visit : [http://e-smartdev.com/#!jsPluginList/panAndZoomJQuery](http://e-smartdev.com/#!jsPluginList/panAndZoomJQuery) //is down (16.03.2017) ##Initialization @@ -30,6 +37,7 @@ options = {'top' : '0', // zoom target container top position in pixel 'mouseMoveEnabled' : true, // enable plugin target drag behviour 'moveCursorEnabled' : true, // show moveCursor for drag 'touchEnabled' : true, // enable plugin touch interaction + 'Border' : true enable border by the container inside 'dblTapEnabled' : true, // enable plugin double tap behaviour 'pinchEnabled' : true, // enable zoom when user pinch on target 'touchMoveEnabled' : true, // enable target move via touch @@ -75,6 +83,20 @@ __Arguments__ 2. `pixelsToMoveOnY` _{Object}_: Pixels to add on vertical axis. 3. `duration` _{Number}_: Effect duration in millisecondes. (Default 700) + +###`smartZoom("moveToAndScale", coodsX, coodsY, scale)` +Move and Zoom to the given position. +```js + jQuery(document).ready(function(){ + $('#domElementToZoom').smartZoom("moveToAndScale", 100, 100, 2); + }); +``` +__Arguments__ + + 1. `coodsX` _{Number}_: Position to move on horizontal-axis + 2. `coodsY` _{Number}_: Position to move on on vertical axis. + 3. `scale` _{Number}_: Set the scale. (Default 700) + ###`smartZoom("destroy")` Remove and clean the plugin. ```js diff --git a/example/index.html b/example/index.html index accee04..068d806 100644 --- a/example/index.html +++ b/example/index.html @@ -17,7 +17,7 @@ - +