瀏覽代碼

[Examples] Product image now changes on clicking product image thumb (#2509)

Co-authored-by: EloquentShashank <52653070+EloquentShashank@users.noreply.github.com>
bansalshashank 5 年之前
父節點
當前提交
8a66185901
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      dist/js/demo.js

+ 7 - 0
dist/js/demo.js

@@ -416,4 +416,11 @@
 
     return $block
   }
+
+  $('.product-image-thumb').on('click', function() {
+    const image_element = $(this).find('img');
+    $('.product-image').prop('src', $(image_element).attr('src'))
+    $('.product-image-thumb.active').removeClass('active');
+    $(this).addClass('active');
+  });
 })(jQuery)