Using alongside with Webp images

Display several small images against a main product. Clicking these images swaps the main product image.
Post Reply
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Using alongside with Webp images

Post by norman »

Multi Product Images needs some tweaks to work alongside webp images. In your webp product image layout make sure the <img...> tag has an attribute:

Code: Select all

		id="im-<Actinic:Variable Name="EncodedProductAnchor" />"
Then in file multiproductimagesupport.js look for the line:

Code: Select all

function mpi_imageswitch(swapimage, newimage){
And add a line below it:

Code: Select all

	swapimage.parent('picture').find('source').remove();
This will remove all the source tags from a product image when an additional image is selected, thus allowing the <img...> tag to show the alternate image.
Norman
Post Reply