Could i modify this existing code to automatically scroll through the list items to display the content?
Sorry, the: ul li a {} links.
Maybe using "interval" method?
$(document).ready(function(){
$('ul.tabNav a').click(f开发者_JAVA技巧unction() {
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;
});
});
There are millions of plugins that do exactly that. Let's not reinvent the wheel and try one of these or these.
Edit: There are special timer plugins as well, take a look at this one.
精彩评论