Jet Zoom API

The Jet Zoom JavaScript API allows developers to interact with Jet Zoom and add additional functionality.

Class JetZoom

This is the main JetZoom class.

Creating an Instance

You can create your own instances like this:

options = {}; // This would be your options object.
$('#myImage').JetZoom(options);                  // jQuery way.
myInstance = new JetZoom($('#myImage'),options); // 'normal' way.

Getting an Instance

You can get the Jet Zoom instance that belongs to a particular image:

myInstance = $('#myImage').data('JetZoom');

Calling Methods

Once an instance has been obtained, call methods like this:

myInstance.loadImage('/smallimage.jpg','/largeimage.jpg');
myInstance.destroy();

Calling Static Methods

Call static methods like this:

JetZoom.someStaticMethod();

Handling Jet Zoom Events

Bind handlers to Jet Zoom events like this:

$('#myImage').bind('jetzoom_ready',function(){alert('Jet Zoom is ready!'});
Method Summary
Method Attributes Method Name and Description
 
Test API call.
 
Removes Jet Zoom from the image.
 
Loads a new image into a Jet Zoom instance
<static>  
JetZoom. .quickStart
Quick start function for Jet Zoom
<static>  
JetZoom. .setAttr

Sets the attribute name to use for defining Star Zoom options in HTML.

Event Summary
Event Attributes Event Name and Description
<static>  
JetZoom.jetzoom_ready()
Fired when an images have loaded succesfully.
Class Detail
JetZoom($image, options)
Parameters:
{jQuery} $image
jQuery image element to zoom.
{Object} options
Options object.
Method Detail
apiTest()
Test API call. Alerts a test message confirming that the API is working.

destroy()
Removes Jet Zoom from the image.

loadImage(imagePath, zoomImagePath)
Loads a new image into a Jet Zoom instance
Parameters:
{string} imagePath
Path to small image.
{string} zoomImagePath
Path to zoom image.

<static> JetZoom.quickStart()
Quick start function for Jet Zoom

<static> JetZoom.setAttr(attr)

Sets the attribute name to use for defining Star Zoom options in HTML.
Default is data-jetzoom.

This can be useful when you don't want to use HTML5 style data attributes.
For instance, you could set the attribute name to 'rel' or 'onclick'

Parameters:
{String} attr
The name of the attribute.
Event Detail
<static> JetZoom.jetzoom_ready()
Fired when an images have loaded succesfully.