PDA

View Full Version : Simple Image Panner and Zoomer v1.1 want zoom level to default back to 1 on change



nick_1
01-23-2012, 05:21 PM
1) Script Title:
Simple Image Panner and Zoomer v1.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagepanner.htm

http://www.dynamicdrive.com/dynamicindex4/imagepanner.js

3) Describe problem:
I have a page with one main image being displayed. The displayed content image changes when a thumbnail of another image is clicked. The image panner and zoomer allows me to zoom in and pan the image and it does change the image when the thumbnails are clicked. The issue is if I am zoomed in and then change the image by clicking a thumbnail the new image is also zoomed in and I have to zoom out.
I would like the image to reset to zoom level 1 when you click a thumbnail and a new image is displayed.

jscheuer1
01-24-2012, 11:02 AM
Use this updated version of imagepanner.js:

4286

Then give all of your thumbnails a class if they don't have it already - say thumbnails.

And put this script in the head of the page after the other scripts:


<script type="text/javascript">
jQuery(function($){
$('.thumbnails').click(function(){
$('img[title="Zoom Out"]').trigger('reset');
});
});
</script>

The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please post a link to the page on your site that contains the problematic code so we can check it out.