Well this script is useless on most mobile/touch devices as well because it requires actions they're incapable of. So I would provide alternate content via a link for users that cannot use it. That said, here's an update of the script that allows for button control of the zoom level (right click and 'Save As'):
multizoom.js
To use it, say you have a zoom setup on the page (it must have a zoomrange for this to work):
Code:
<script type="text/javascript">
jQuery(document).ready(function($){
$('#image1').addimagezoom({
zoomrange: [3, 10],
magnifiersize: [300,300],
magnifierpos: 'right',
cursorshade: true,
largeimage: 'hayden.jpg' //<-- No comma after last option!
})
});
</script>
Now you can have buttons, images or links like:
Code:
<input class="image1 zoom in
" type="button" value="Zoom In"> <input class="image1 zoom out
" type="button" value="Zoom Out">
The important thing is the class. It must have the id of the image (image1 in this case), the word zoom, and then either in or out (for which way you want clicking on it to zoom the image. It cannot have any other names in its class and it must have the image id, zoom and one of either in or out.
You can also have a span with a class of 'id_of_the_image zoomlevel
':
Code:
Curent Zoom: <span class="image1 zoomlevel
"></span>
It will show the current zoom level.
Also works with multi-zooms.
Any questions, just let me know.
Bookmarks