🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

zoompanzoom.js is a really small jQuery plugin which enables the user to zoom in/out and pan any elements (divs, text, images, svgs, etc.) within a specific container.

pan

Documentation

Zoompanzoom---Light-weight-zooming-and-panning

Light weight zooming and panning Jquery plugin

Zoompanzoom is a lightweight jQuery plugin for Zooming and Panning different elemets like div , Image , SVG etc.

Dependant files - Jquery and Jquery UI

How to use

  1. Create a div and assign an id
  2. Use the id to initialise the plugin
$("#my_div").zoompanzoom();

Options

1.animationSpeed - possible values can be slow,normal,fast or any other number $("#my_div").zoompanzoom({ animationSpeed: "slow"
});

2.zoomfactor - The factor by which the zoom out or zoom in will happen

default value - 0.1
3.maxZoom - maximum zoom
default value - 3
4.minZoom - Minimum zoom
default value - 0.5
5.disablePan - false to disable panning. Default value is true.

Complete Example:

$("#my_div").zoompanzoom({     animationSpeed: "slow",     zoomfactor: .8,     maxZoom: 2.5,     minZoom: 0.9,     disablePan: false   	}); 

You May Also Like