Results 1 to 2 of 2

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

  1. #1
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple Image Panner and Zoomer v1.1 want zoom level to default back to 1 on change

    1) Script Title:
    Simple Image Panner and Zoomer v1.1

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...magepanner.htm

    http://www.dynamicdrive.com/dynamici...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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    Use this updated version of imagepanner.js:

    Attachment 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:

    Code:
    <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.
    Last edited by jscheuer1; 01-24-2012 at 03:33 PM. Reason: better way
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •