Documentation

Logo

Overview


The jQuery Loupe is a jQuery plugin written by Marius Stanciu - Sergiu, a plugin which gives you the ability to add zoom on hover ability for your photos with single line of code. With Loupe you have the ability to control the zoom level and loupe size via mouse scroll which gives you the opportunity to enlarge areas that you might be interested in.

Download


You can download the last version of the plugin, or browse the archive for older versions.

Usage

First you need to include the jQuery library, since Loupe is a plugin. You can download it from the jQuery website or link it directly from the Google CDN.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

Secondly, you need to include the jQuery Loupe javascript and the css file into your page. You can do it by adding the code below to your page.

<script type="text/javascript" src="js/jquery.loupe.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.loupe.css" />

Next, you implement the actual image(s) that will be magnified/zoomed by the Loupe. The structure is as simple as it can get.

<a href="#"><img alt="Your image caption" src="your-image.jpg" id="loupe1" /></a>

As the last step, you trigger the Loupe function on the element you just created. In this case, we trigger the function on the image with the id loupe1.

<script type="text/javascript">
$(document).ready(function(){
   $('#loupe1').loupe({
      'max_size' : 600,
      'loupe_toggle_time' : 'fast'
   });
});
</script>

Options


shape - the shape of the Loupe. Options can be: circle/rounded/square

glossy - if the Loupe is glossy or not. Options: true/false

drop_shadow - if the Loupe will have a drop-shadow effect. Options: true/false

Demo

Classic rounded shape of loupe, dark semi-transparent overlay and 100% zoom for best visual effect. Use mouse scroll to change size of loupe or hold 'z' on keyboard and scroll to change the zoom.

This example shows loupe with some custom settings. Almost every aspect of look and feel can be changed. Here custom image overlay is applied, shape, size, snap, min/max size are changed also. You can easily allow/forbid size/zoom changing to end user. Zoom in is disabled, but use mouse scroll to change size of loupe.

Here we can see squared shape in action. Shadow and lens glossy effect can easily be removed using plugin settings. Use mouse scroll to change size of loupe or hold 'z' on keyboard and scroll to change the zoom.

Once again classic rounded loupe but this time without image overlay and optional shadow. Use mouse scroll to change size of loupe or hold 'z' on keyboard and scroll to change the zoom.

This time we specify other image which has to be rendered inside loupe. Basically it's the same image as source but with one difference - it's not a greyscale image. Using different images as thumb and target is very easy to setup and can create stunning effects. No resize & zoom allowed - scroll event ignore and handled by browser - scrolls page.

The same story here - two images one normal and second altered for a nice effect. Use mouse scroll to change size of loupe or hold 'z' on keyboard and scroll to change zoom factor.

To Top