To enable swipe functionality between tab panes on mobile in Webflow, you’ll need to add custom JavaScript along with a minimal library or touch event listeners.
tab-pane
) for targeting.#tabs
) and all Tab Panes a common class (e.g., .tab-pane
).tag, and paste JavaScript.
Example using native Vanilla JS touch detection:
let startX = 0;let endX = 0;const tabPanes = document.querySelectorAll('.tab-pane');const tabs = document.querySelectorAll('.w-tab-link'); // Default Webflow tab menu classlet currentIndex = 0;// Add touch event listenerstabPanes.forEach((pane, index) => { pane.addEventListener('touchstart', function(e) { startX = e.touches[0].clientX; }); pane.addEventListener('touchend', function(e) { endX = e.changedTouches[0].clientX; handleSwipe(index); });});function handleSwipe(index) { // Swipe left if (startX - endX > 50 && index < tabs.length - 1) { tabs[index + 1].click(); } // Swipe right if (endX - startX > 50 && index > 0) { tabs[index - 1].click(); }}
To enable swipe between Tab Panes in Webflow on mobile, add touch event listeners to each pane and use JavaScript to simulate tab clicks. This adds intuitive mobile navigation without needing third-party plugins.