Skip to content
This repository was archived by the owner on Aug 21, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#Zoom and pan jQuery plugin
# Zoom and pan jQuery plugin

This plugin manage smooth zoom and pan on a given dom element. The plugin works on mobile and pc and use CSS3 transitions on compatible web browsers. (javascript is used for old web browsers)

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)

##Initialization
## Initialization

```js
$(document).ready(function() {
$("#elementToZoomOn").smartZoom(); // start plugin behaviour
});
```

##Options
## Options
You can customize smartZoom plugin behaviour with an option object.
```js
options = {'top' : '0', // zoom target container top position in pixel
Expand Down Expand Up @@ -43,9 +43,9 @@ This sample code set the maximum scale to 4 and apply a red background to the zo
$("#elementToZoomOn").smartZoom({'maxScale':4, 'containerBackground':'#FF0000'}); // start plugin behaviour
});
```
##Methods
## Methods

###`smartZoom("zoom", scaleToAdd, globalRequestedPosition, duration)`
### `smartZoom("zoom", scaleToAdd, globalRequestedPosition, duration)`
Zoom on a given position.
```js
jQuery(document).ready(function(){
Expand All @@ -60,7 +60,7 @@ __Arguments__
2. `globalRequestedPosition` _{Object}_: Position to zoom on. (Default target center)
3. `duration` _{Number}_: Effect duration in millisecondes. (Default 700)

###`smartZoom("pan", pixelsToMoveOnX, pixelsToMoveOnY, duration)`
### `smartZoom("pan", pixelsToMoveOnX, pixelsToMoveOnY, duration)`
Move the target on the given position.
```js
jQuery(document).ready(function(){
Expand All @@ -75,7 +75,7 @@ __Arguments__
2. `pixelsToMoveOnY` _{Object}_: Pixels to add on vertical axis.
3. `duration` _{Number}_: Effect duration in millisecondes. (Default 700)

###`smartZoom("destroy")`
### `smartZoom("destroy")`
Remove and clean the plugin.
```js
jQuery(document).ready(function(){
Expand All @@ -84,7 +84,7 @@ Remove and clean the plugin.
```
Remove the plugin behaviour.

###`smartZoom("isPluginActive"):Boolean`
### `smartZoom("isPluginActive"):Boolean`
Check if the plugin is active or not.
```js
jQuery(document).ready(function(){
Expand Down