The Cloud Zoom JavaScript API allows developers to interact with Cloud Zoom and add additional functionality.
You can create your own instances like this:
options = {}; // This would be your options object. $('#myImage').CloudZoom(options); // jQuery way. myInstance = new CloudZoom($('#myImage'),options); // 'normal' way.
You can get the Cloud Zoom instance that belongs to a particular image:
myInstance = $('#myImage').data('CloudZoom');
Once an instance has been obtained, call methods like this:
myInstance.loadImage('/smallimage.jpg','/largeimage.jpg'); myInstance.destroy();
Call static methods like this:
CloudZoom.someStaticMethod();
Bind handlers to Cloud Zoom events like this:
$('#myImage').bind('cloudzoom_ready',function(){alert('Cloud Zoom is ready!')});
Method Attributes | Method Name and Description |
---|---|
Test API call.
|
|
Closes the zoom window if visible.
|
|
Removes Cloud Zoom from the image.
|
|
Loads a new image into a Cloud Zoom instance
|
|
<static> |
CloudZoom.
.quickStart
Quick start function for Cloud Zoom
|
Refresh image function.
|
|
<static> |
CloudZoom.
.setAttr
Sets the attribute name to use for defining Star Zoom options in HTML. |
Event Attributes | Event Name and Description |
---|---|
<static> |
CloudZoom.cloudzoom_ready()
Fired when a images have loaded succesfully.
|
Sets the attribute name to use for defining Star Zoom options in HTML.
Default is data-cloudzoom.
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'