Advertisement
danine1

product-detail click through images

Aug 31st, 2020
2,895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.37 KB | None | 0 0
  1. <script>
  2.  
  3. // product detail page toggle image
  4. function myFunction(imgs) {
  5.   // Get the expanded image
  6.   var expandImg = document.getElementById("expandedImg");
  7.  
  8.   // Use the same src in the expanded image as the image being clicked on from the grid
  9.   expandImg.src = imgs.src;
  10.   // Show the container element (hidden with CSS)
  11.   expandImg.parentElement.style.display = "block";
  12. }
  13.  
  14.  
  15. </script>        
  16.  
  17.  
  18. <aside class="col-md-6">
  19.             <div class="card">
  20.               <article class="gallery-wrap klang-gallery-wrap">
  21.                 <div class="img-big-wrap">
  22.                     <img id="expandedImg" src="images/items/product-images/gibson-sg-2.jpg" onclick="myFunction(this);" />
  23.                 </div>
  24.                 <!-- slider-product.// -->
  25.                 <div class="thumbs-wrap">
  26.                     <img class="item-thumb" src="images/items/product-images/gibson-sg-2.jpg" onclick="myFunction(this);"/>
  27.                     <img class="item-thumb" src="images/items/product-images/gibson-sg-3.jpg" onclick="myFunction(this);"/>
  28.                     <img class="item-thumb" src="images/items/product-images/gibson-sg-4.jpg" onclick="myFunction(this);"/>
  29.                 </div>
  30.                 <!-- slider-nav.// -->
  31.               </article>
  32.               <!-- gallery-wrap .end// -->
  33.             </div>
  34.             <!-- card.// -->
  35.           </aside>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement