I have this script i’m running on the homepage of my site to make a tab behave like a slider and auto rotate the slides.
This script is working on one site but not on the other.
Can someone help me with why this is happening
The slider is the one in the second section
Code:
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
var tabTimeout;
clearTimeout(tabTimeout);
tabLoop();
// define loop - cycle through all tabs
function tabLoop() {
tabTimeout = setTimeout(function() {
var $next = $('.tabs-menu').children('.w--current:first').next();
if ($next.length) {
$next.click(); // click resets timeout, so no need for interval
} else {
$('.tab-link:first').click();
}
}, 11500);
}
// reset timeout if a tab is clicked
$('.tab-link').click(function() {
clearTimeout(tabTimeout);
tabLoop();
});
});
</script>
Site where it’s working: Webflow - WingMan
Site where it’s not working: Webflow - iMocha