Announcement

Collapse
No announcement yet.

Magnify/Zoom image script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Magnify/Zoom image script

    I've got a magnify/zoom image javascript I want to run on product pages to allow for seeing greater product details within the image. The script displays a div with a zoomed-in portion of the image as you mouse over the main product image. As such, the script requires two product images - the main product image and a high-resolution version. The html goes something like this.

    <img src="123456_small.jpg" data-zoomsrc="123456_big.jpg" id="myimage2" style="padding:0px;border:0px;" />
    <div id="myimage2_zoom" style="position: relative; width: 150px; height: 300px; float: right; border: 1px solid black; right: 50px;"></div>

    In this case, 123456_small.jpg would equal &mvt:product:image AND 123456_big.jpg would equal &mvt:product:image with "_big" inserted after the image name and prior to the file extension (.jpg, .gif).

    My question is how can I automatically insert the string "_big" for the data-zoomsrc attribute within the image tag?

    Any help would be greatly appreciated.

    Details of the script can be found here: www.nihilogic.dk/labs/mojozoom/

    #2
    Re: Magnify/Zoom image script

    Why don't you use the thumbnail as the small image and the full size as the big image.

    BTW I don't thing that the _big or _small is important rather the size of the images.
    Andreas Toman
    PCINET, LLC

    Miva Merchant Design, Development, Integration & Support
    We built over 200 Miva Merchant stores!
    Miva shopping cart design & integration service and see our Portfolio!


    e-mail: [email protected]
    web: www.pcinet.com
    LinkedIn: Andreas Toman
    phone: (786) 250-2056 (Miami, FL)

    Comment


      #3
      Re: Magnify/Zoom image script

      Thanks and I like your thinking on this but don't believe using the thumbnail as the small image AND the main product image as the large image would work. That would really mess up my category page images (they would have to be much larger).

      Any other thoughts?

      Can I call the product's number and supplement it with a "_big.jpg" or something like that?

      Comment


        #4
        Re: Magnify/Zoom image script

        If you mean the product code, yes.

        Code:
        &mvt:product:code;
        will render the product code, so if your product code is '1234', then:

        Code:
        <img src="graphics/00000001/&mvt:product:code;_big.jpg">
        will call the image:

        graphics/00000001/1234_big.jpg">
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          Re: Magnify/Zoom image script

          Bruce, many thanks! Works like a charm thanks to you.

          Comment

          Working...
          X