开发者

is it possible to use scrollable (jQuery tools) with just one item?

开发者 https://www.devze.com 2023-02-20 02:41 出处:网络
I am trying to work out if it is possible to use scrollable, part of jQuery tools, to scroll through 1 item/div vertically.At the moment I can only get it w开发者_Python百科orking with at least two DI

I am trying to work out if it is possible to use scrollable, part of jQuery tools, to scroll through 1 item/div vertically. At the moment I can only get it w开发者_Python百科orking with at least two DIVS. It seems to be set up as an image gallery scroller, but I would like to use it to scroll a playlist vertically and there would be one DIV for the playlist.

If it does have to have at least two DIVs I was wondering if I could set the second DIV to have a height of 1px, or to be hidden? At the moment it seems like all the DIVs have to have the same height.

Thanks,

Nick.


It really depends on which plugin you are using. For example jcarousel ( http://sorgalla.com/jcarousel/ ) you can do it via customizing the options. The options are available here: http://sorgalla.com/projects/jcarousel/


Nick, I think what you are asking is how to get the scroll animation to play automatically for one item? If so, I believe you need to set the circular (i.e. loop) parameter to true.

e.g. circular: true

Something like this:

$(document).ready(function() {
    $.easing.custom = function (x, t, b, c, d) {
        var s = 1.10158;
        if ((t/=d/2) < 1)
            return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
        return c/2*((t-=2)*t*(((s*=(1.925))+1)*t + s) + 2) + b;
    }

    var root = 
        $(".scrollable").scrollable({
            easing: 'custom',
            speed: 800,
            circular: true
        }).autoscroll(5400, {
            autoplay: true
        });

    window.api = root.data("scrollable");
});
0

精彩评论

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