I have this function, $('.trigger-list li ').addClass('animate');
I have a list with 5 list items. When i fire this code. Every second one list item must get the classe animate. How can i set a interval on this?
Thanks
I have this function, $('.trigger-list li ').addClass('animate');
I have a list with 5 list items. When i fire this code. Every second one list item must get the classe animate. How can i set a interval on this?
Thanks
Try this:
setInterval(function() {
$('.trigger-list li ').addClass('animate');
}, 2000);
try using the jQuery :odd
selector https://api.jquery.com/odd-selector/
$('.trigger-list li:odd ').addClass('animate');