Zoom command
Zoom into an image on mouseover.
Basic Usage (HTML)
data-jkit="[zoom:scale=2]"
Advanced Init (JavaScript)
$('#myelement').jKit('zoom', { 'scale': '2' });
Options
Option | Values | Default | Description |
---|---|---|---|
scale | Float | 2 | The scaling factor on mouseover |
speed | Int or “fast”, “slow” (Milliseconds) | 150 | The duration of the blend in and out animation in milliseconds, bigger = slower. |
lightbox | “yes” or “no” | no | If this is set to “yes”, a click will open the image in a lightbox |
Events
Event | Description |
---|---|
zoomin | Triggered on zooming into the image |
zoomout | Triggered on zooming out |
Examples
Basic example:
Zoom an image two times (the image has to be two times bigger than the embedded size!):
Source:
<img src="../img/newyorkcity_1280x800.jpg" width="640" data-jkit="[zoom]">
More zoom:
Here’s an example with a zoom factor of four:
Source:
<img src="../img/monsters.jpg" width="640" data-jkit="[zoom:scale=4]">
Event example:
In this one we’re expanding our basic example with an extra div that is shown on the zoomin and hidden on the zoomout event:
Source:
<img src="../img/newyorkcity_1280x800.jpg" width="640" data-jkit="[zoom.newyork]"> <div style="display:none" data-jkit="[show:speed=250;animation=grow;onevent=newyork.zoomin][hide:speed=250;animation=grow;onevent=newyork.zoomout]"> <strong>So much detail, it's crazy! ;-)</strong> </div>
Lightbox example:
This one has an added lightbox on click:
Source:
<img src="../img/newyorkcity_1280x800.jpg" width="640" data-jkit="[zoom:lightbox=yes]">
Replacements
There are currently no replacements for this command.
[ Learn more about replacements ]
Discussions
Do you have questions or do you want to suggest new features? Than head over to our new community:
[ jKit Community ]