Magnify Images On Hover Or Touch & Hold - jQuery izoomify

Magnify Images On Hover Or Touch & Hold - jQuery izoomify
File Size: 5.22 KB
Views Total: 1218
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

izoomify is a lightweight, smooth, and mobile-friendly image zoom plugin for magnifying and panning images using mouseover, mousemove, and touch-hold events.

How to use it:

1. Include the jquery.izoomify.js after you've loaded the latest jQuery library.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/jquery.izoomify.js"></script>

2. Add the image to be maganified to a container.

<div class="example">
  <img src="image.jpg" alt="Image To Zoom" />
</div>

3. Call the izoomify plugin on the parent container and done.

$(function(){
  $('.target').izoomify();
});

4. Load the hi-res version of the image when maganifying. Good for better page load performance.

<div class="example">
  <img
    src="thumb.jpg"
    data-izoomify-url="full.jpg"
    alt="Image To Zoom"
  />
</div>
// OR Via JavaScript
$('.example').izoomify({
  url: "full.jpg",
});

5. Set the zoom factor. Default: 1.2.

<div class="example">
  <img
    src="thumb.jpg"
    data-izoomify-url="full.jpg"
    data-izoomify-magnify="2.5"
    alt="Image To Zoom"
  />
</div>
// OR Via JavaScript
$('.example').izoomify({
  url: "full.jpg",
  magnify: 2.5
});

6. Set the duration of the zoom in/out animation. Default: 120ms.

<div class="example">
  <img
    src="thumb.jpg"
    data-izoomify-url="full.jpg"
    data-izoomify-duration="300"
    alt="Image To Zoom"
  />
</div>
// OR Via JavaScript
$('.example').izoomify({
  url: "full.jpg",
  duration: 300,
});

7. Enable/disable touch & hold support. Default: true.

$('.example').izoomify({
  url: "full.jpg",
  touch: false,
});

8. Trigger a function after the plugin has been loaded.

$('.example').izoomify({
  url: "full.jpg",
  callback: function () {
    //your code here..
  }
});

This awesome jQuery plugin is developed by abiacarl. For more Advanced Usages, please check the demo page or visit the official website.