Skip to content

Instantly share code, notes, and snippets.

@ronaldgreeff
Created January 14, 2020 09:38
Show Gist options
  • Save ronaldgreeff/6bbbfe40cb8cd1cab46a393826ab8623 to your computer and use it in GitHub Desktop.
Save ronaldgreeff/6bbbfe40cb8cd1cab46a393826ab8623 to your computer and use it in GitHub Desktop.
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