You are currently viewing Image Gallery in Product page with JavaScript

Image Gallery in Product page with JavaScript

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

Leave a Reply