Image Gallery in Product page with JavaScript

gallery-image-change-on-product-page

Step 1: Copy the code below & paste it on your product page in the big image(change the src of image with your product image source)

				
					<img decoding="async" src="your image loccation" id="imageBox">
				
			

Step 2: Copy the code below & paste it on your product page in the small images (change the src of image with your product image source)

				
					<img decoding="async" src="your image loccation" onclick="myFunction(this)">
				
			

Step 3: Copy the code below & paste it on your product page before the body tag end.

				
					    <!-- js for gallery image -->
    <script>
        function myFunction(smallImg)
        {
            var fullImg = document.getElementById("imageBox")
            fullImg.src = smallImg.src;
        }
    </script>
				
			
Facebook
Twitter
LinkedIn
Pinterest

Leave a Reply