开发者

Using jquery.SerialScroll how do I force a start on a particular page without effect

Im using the jquery plugin SerialScroll. I want it, when initialised, to start on a particular page (ie a list 开发者_JAVA技巧item n numbers in) without the transition effect. And therafter when next or prev is invoked to scroll with the transition effect.

$('#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 ){
        }
    });

I suppose I could put it another way how do I suspend /resume the duration variable while I run

$('#sections').trigger('goto',[page_index]);

Thanks in advance


From the documentation:

start: first element of the series (zero-based index, 0 by default).

So I assume can simply use start:4 to start at the fifth item

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜