Touch-enabled Element Zoom & Pan Library – EasyPZ

Category: Javascript , Zoom | February 15, 2019
Author: michaschwab
Views Total: 1,220
Official Page: Go to website
Last Update: February 15, 2019
License: MIT


Touch-enabled Element Zoom & Pan Library – EasyPZ


EasyPZ is a standalone, dependency-free JavaScript library used to zoom and pan any element with mouse and touch interactions.

Basic usage:

Download and insert the JavaScript file ‘easypz.latest.min.js’ into the web page.

<script src="easypz.latest.min.js"></script>

Add the ‘easypz’ attribute to element you want to zoom and pan.

<svg easypz='{"applyTransformTo": "svg > *"}' height="400" width="400">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:nonzero;" />

All possible options.

applyTransformTo: "",
replaceVariables: false

Callback functions available.

onPanned: function() {},
onZoomed: function() {},
onTransformed: function() {},
onResetAbsoluteScale: function() {},



  • Bugfix


  • Allow switching between mouse- and touch-based interactions on hybrid devices.


  • Tweak to make the momentum interactions more flexible and obtain more information.

You Might Be Interested In:

Leave a Reply