基于活动元素自动滑动滚动条

Auto slide scrollbar based on active element

本文关键字:滚动条 元素 于活动 活动      更新时间:2023-09-26

我正在使用NivoSlider,并对核心进行了一些编辑,以围绕缩略图创建UL,从而能够为它们提供更好的标记。对于一些jQuery,我正在根据Nivo给出的"活动"类更改alpha。现在我想知道我是否可以根据例如每4个项目自动将缩略图容器向右滑动,因为那是看不见的。我想用模运算符做点什么,但真的想不出一个公式来帮助我。。。

jQuery('#pageSlider').nivoSlider({
    effect: 'slideInLeft',          // Specify sets like: 'fold,fade,sliceDown'
    directionNav: false,                // Next & Prev navigation
    controlNav: true,                   // 1,2,3... navigation
    controlNavThumbs: true,         // Use thumbnails for Control Nav
    afterChange: function(){        // Triggers before a slide transition
        jQuery('.nivo-controlNav.nivo-thumbs-enabled ul li').each(function() {
            jQuery(this).css({'opacity':'0.5'});
        });
        jQuery('.nivo-controlNav.nivo-thumbs-enabled ul li .nivo-control.active').parent().css({'opacity':'1'});
    },
    pauseTime: 5000                         // How long each slide will show -- bottom for IE7 fix
});

http://imgur.com/tdInJpJ[还没有足够的图像代表,抱歉]

我花了一段时间,但我想明白了。最终,我全力以赴,不断为NivoSlider添加功能。对于任何遇到过同样问题的人:http://tinyurl.com/p72kbna