Documentation
To use in your project copy the build folder, and add a script tag referencing the build file:
<script src="./build/jquery.dramaticzoom.min.js"></script>
<link rel="stylesheet" href="./build/jquery.dramaticzoom_editor.css">
<script src="./build/jquery.dramaticzoom_editor.min.js"></script>
$("#img_id").DramaticZoom({
editor: true,
camera_x: 190, camera_y: 60,
camera_width: 80, camera_height: 80,
interpolator_index: 28,
duration: 500,
event: 'mouseover'
});
Options
event | Valid options are 'click', 'mouseover', 'dblclick', 'auto' (automatically zooms over and over), and 'none' which means you'll have to use the api to call the zoom. |
editor | Is the editor is enabled? (boolean value) |
camera_x, camera_y, camera_width, camera_height | These options set where the zoom occurs. The camera_x and camera_y are the CENTER of where the zoom occurs. |
duration | How long does it take to zoom in on the target? (in milliseconds) |
interpolator_index | The index of the interpolator used. Interpolators allow the zooming to occur non-linearly. To find out the index of the interpolator you want you can try different interpolators in the Zoom Tester. |
reset_time | How long before the image should reset after zooming in? |
width, height | A canvas is created to replace the image you want zoomed. You can set the width/height of the canvas... otherwise the original image width/height will be used. |
constrain_editor_proportions | When using the editor is the zoom target proprotional to the image. If it is then resizing in the editor occurs proportional to image width/height. |
API Methods
doZoom()
After initializing the zoom canvas, you can call the zoom with the doZoom() function:
$().DramaticZoom.doZoom("#img_id");
updateOptions()
You can update the options on the fly by calling the updateOptions function:
$.fn.DramaticZoom.updateOptions("#img_id",
{
camera_x: 354, camera_y: 83,
camera_width: 127, camera_height: 112,
interpolator_index: 64
});