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/
<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/
Comment