开发者

jQuery automatic scroll / slideshow

开发者 https://www.devze.com 2022-12-30 03:17 出处:网络
Could i modify this existing code to automatically scroll through the list items to display the content?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消