JQZoom Image Magnifier

JQZoom is a javascript image magnifier built at the top of the jQuery javascript framework. jQzoom is an easy to use script to magnify / zoom part or image; with on or multiple images (gallery).


Home page is at: http://www.mind-projects.it/projects/jqzoom/
• Downloaded from: http://coursesweb.net/jquery/jqzoom-image-magnifier_jp

- Examples are in "demos" folder.

Installation

1. First, to use this plugin, copy the "css" and "js" folders (or their files in "css", respectively "js" folders) on your server. The script comes with jQuery 2.1.0 ("jquery.js" in "js/" directory).
2. Include these files in the <head> zone of your web page:
<link rel="stylesheet" type="text/css" href="css/jqzoom.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.jqzoom-min.js"></script>
3. The HTML code with the image must be added in this format:
<a href="images/BIGIMAGE.JPG" class="MYCLASS" title="MYTITLE">  
  <img src="images/SMALLIMAGE.JPG" title="IMAGE TITLE">  
</a>

The anchor element wraps the small image you would like to zoom. The necessary and base elements are:

    SMALLIMAGE.JPG - Represents the small image you would like to zoom.
    BIGIMAGE.JPG - Represents the big image that jQZoom will reveal.
    MYCLASS - Represents the anchor class,that would be used to instantiate the jQZoom script to all the elements matching this class (you can use an ID as well).
    MYTITLE / IMAGE TITLE - Anchor title and/or image title that will be used to show the zoom title close to the jQZoom Window.

- The SMALLIMAGE must be a scaled versione of the BIGIMAGE.


4. Then load the plugin at window load.
<script>
$(document).ready(function(){  
  $('.MYCLASS').jqzoom();  
});
</script>
This will instantiate jQzoom in standard mode. You can pass more options, as in the example below.
<script>
$(document).ready(function(){  
  var options = {  
    zoomType: 'standard',  
    lens: true,  
    preloadImages: true,  
    alwaysOn: false,  
    zoomWidth: 300,  
    zoomHeight: 250,  
    xOffset: 90,  
    yOffset: 30,  
    position: 'left'  
    //...MORE OPTIONS
  };
  $('.MYCLASS').jqzoom(options);
});
</script>

Image Gallery with JQZoom

The JQZoom plugin can also be used to create image gallery with zoom efect.
1. Attach the gallery ID to your main anchor "rel" attribute.
<a href="images/BIGIMAGE.JPG" class="MYCLASS" title="MYTITLE" rel="gal1">  
  <img src="images/SMALLIMAGE.JPG" title="IMAGE TITLE">  
</a>
2. Manage your thumbnails "class" and "rel" attributes.
- The class "zoomThumbActive" is attached to your thumbnails by jQzoom. By default specify this class to the selected thumbnail.
<a class="zoomThumbActive" href="#" rel="{gallery: 'gal1', smallimage: './imgProd/SMALLIMAGE1.jpg',largeimage: './imgProd/LARGEIMAGE1.jpg'}">  
  <img src="imgProd/thumbs/THUMBIMG1.jpg" title="thumb1" />
</a>

In image gal1, the structure of the thumbnail "rel" attribute is very important.The base elements are:

    gallery : the ID of the gallery to which it belongs.
    smallimage : the path to the SMALLIMAGE to be loaded on the when you click on the thumbnail.
    largeimage : the path to the LARGEIMAGE

Configuration Options