使用jquery.SerialScroll如何在没有效果的情况下强制启动特定页面

时间:2011-10-03 15:57:01

标签: javascript jquery

我正在使用jquery插件SerialScroll。我希望它在初始化时,在没有过渡效果的特定页面(即列表项n数字)上开始。并且当调用next或prev时,可以使用过渡效果滚动。

$('#screen').serialScroll({
        target:'#sections',
        items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
        prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
        next:'img.next',// Selector to the 'next' button (absolute too)
        axis:'xy',// The default is 'y' scroll on both ways
        navigation:'#navigation li a',
        duration:700,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
        cycle: false,
        onBefore:function( e, elem, $pane, $items, pos ){
            e.preventDefault();
            if( this.blur )
                this.blur();
                $('.prev').add($('.next')).show();
            if( pos == 0 )
                $('.prev').hide();
            else if( pos == $items.length-1 )
                $('.next').hide();
        },
        onAfter:function( elem ){
        }
    });

我想我可以用另一种方式说明如何在运行

时暂停/恢复持续时间变量
$('#sections').trigger('goto',[page_index]);

提前致谢

1 个答案:

答案 0 :(得分:0)

来自文档:

  

start:系列的第一个元素(从零开始的索引,默认为0)。

所以我假设可以简单地使用start:4从第五项开始