From 8a66185901c6a54face97817a184df50e8f329ea Mon Sep 17 00:00:00 2001 From: bansalshashank <46516215+bansalshashank@users.noreply.github.com> Date: Fri, 24 Jan 2020 17:25:01 +0530 Subject: [PATCH] [Examples] Product image now changes on clicking product image thumb (#2509) Co-authored-by: EloquentShashank <52653070+EloquentShashank@users.noreply.github.com> --- dist/js/demo.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dist/js/demo.js b/dist/js/demo.js index 9a054b85a..ff168b580 100644 --- a/dist/js/demo.js +++ b/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)