Advanced Search

Results 1 to 2 of 2

Thread: Disable zoom in Image Power Zoomer

  1. #1
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Disable zoom in Image Power Zoomer

    1) Script Title:
    Image Power Zoomer v1.1

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

    3) Describe problem:
    I would like to dynamically toggle on/off the powerzoom feature, so the zoom box can be hidden/shown. I would need something like
    $('#myimage').removepowerzoom();

    that would the the reverse of $('#myimage').addpowerzoom().

    What's the best way of achieving this?

  2. #2
    Join Date
    Aug 2004
    Posts
    9,864
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    The easiest way is probably just to hide the magnifying glass (it's still enabled on the image, just invisible now) on demand. You can do it with something like the function in red below:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    
    <script type="text/javascript" src="ddpowerzoomer.js">
    
    /***********************************************
    * Image Power Zoomer- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
    ***********************************************/
    
    </script>
    
    <script type="text/javascript">
    
    jQuery(document).ready(function($){ //fire on DOM ready
     $('#myimage').addpowerzoom()
    })
    
    function showhidezoom(action){
    	ddpowerzoomer.$magnifier.outer.css({visibility:(action=="show")? "visible" : "hidden"})
    }
    
    
    </script>
    
    <body>
    
    <img id="myimage" src="test.jpg" style="width:200px; height:150px" />
    
    <p><a href="javascript:showhidezoom('show')">Show</a> <a href="javascript:showhidezoom('hide')">Hide</a>
    DD Admin

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
  •