Can I modify this existing code to automatically scroll through list items to display content?
Sorry: ul li a {} links.
Maybe the "interval" method is used?
$(document).ready(function(){
$('ul.tabNav a').click(function() {
var curChildIndex = $(this).parent().prevAll().length + 1;
$(this).parent().parent().children('.current').removeClass('current');
$(this).parent().addClass('current');
$(this).parent().parent().prev('.tabContainer').children('.current').fadeOut('fast',function() {
$(this).parent().children('div:nth-child('+curChildIndex+')').fadeIn('fast',function() {
$(this).addClass('current');
});
$(this).removeClass('current');
});
return false;
});
});
source
share