Shopify themes, liquid, logos, and UX
Heey, how can I add a feature to my slideshow section so that when someone swipes left/right on mobile, it switches to the next image?
Like when you're swiping through Instagram stories — I want the same kind of swipe gesture to switch to the next slide.
Here’s my store: https://creationwithtim.com/products/cinematiq-lut-collection-copy
(Just scroll all the way down to find the slideshow section)
Thanks a lot,
Tim
Solved! Go to the solution
This is an accepted solution.
Hi,
Hope this will help
- Add Hammer.js to Your Theme
- Find Your Slideshow Section Code
- Add an ID to Your Slideshow Container
- Add Swipe Script and include it in theme
Script example
document.addEventListener("DOMContentLoaded", function () {
var slideshow = document.getElementById('mobile-swipe-slideshow');
if (!slideshow) return;
var hammer = new Hammer(slideshow);
hammer.on("swipeleft", function () {
document.querySelector('.slideshow__button--next').click();
});
hammer.on("swiperight", function () {
document.querySelector('.slideshow__button--prev').click();
});
});
This is an accepted solution.
Hi,
Hope this will help
- Add Hammer.js to Your Theme
- Find Your Slideshow Section Code
- Add an ID to Your Slideshow Container
- Add Swipe Script and include it in theme
Script example
document.addEventListener("DOMContentLoaded", function () {
var slideshow = document.getElementById('mobile-swipe-slideshow');
if (!slideshow) return;
var hammer = new Hammer(slideshow);
hammer.on("swipeleft", function () {
document.querySelector('.slideshow__button--next').click();
});
hammer.on("swiperight", function () {
document.querySelector('.slideshow__button--prev').click();
});
});
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025