Created
January 14, 2020 09:38
-
-
Save ronaldgreeff/6bbbfe40cb8cd1cab46a393826ab8623 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var productTabs = document.getElementById('products'); | |
var tabs = productTabs.querySelectorAll('li'); | |
var l = tabs.length | |
var delay = 5000 | |
var i = 0 | |
function cycle() { | |
setTimeout(function() { | |
tabs[i].firstElementChild.click(); | |
i++; | |
if (i==l) { | |
i = 0; | |
}; | |
cycle(); | |
}, delay) | |
}; | |
cycle(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment