How can I add a tap function to the slideshow?

How can I add a tap function to the slideshow?

CreatorTim
Trailblazer
471 1 71

Hi, how can I add a feature so that when someone taps on the image in the slideshow, it immediately switches to the next one? Is that somehow possible?

 

Want it mainly for mobile, but it can also works on desktop.

 

Here’s my store: https://creationwithtim.com/products/cinematiq-lut-collection-copy
(Just scroll all the way down to find the slideshow section)

 

Thanks,

Tim

Replies 2 (2)

Small_Task_Help
Shopify Partner
1043 42 98

Hi,

Hope this will help

- Find Slideshow File (something like slideshow.liquid or main-slideshow.liquid.)
- Add a Tap/Click Script

Script example

<script>
  document.addEventListener('DOMContentLoaded', function () {
    // Select the slideshow container (adjust the selector to match your theme)
    const slideshow = document.querySelector('.slideshow'); // You may need to change this!

    if (slideshow) {
      slideshow.addEventListener('click', function () {
        const nextButton = slideshow.querySelector('.slick-next, .swiper-button-next'); // works for Slick or Swiper
        if (nextButton) {
          nextButton.click(); // Go to next slide when clicked/tapped
        }
      });
    }
  });
</script>

- Adjust Selector (Important)

To Get Shopify Experts Help, Click Here or E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert India
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
CreatorTim
Trailblazer
471 1 71

Thank a lot buddy! Appreciate your help