carouFredSel幻灯片自动运行项目麻烦

时间:2015-09-04 05:10:44

标签: jquery

我只是有一个问题,如果我有超过3项,我怎么能让carouFredSel自动运行?我设置项目:3;但它仍然自动运行,即使它里面只有2个项目。 这是我的jquery:

jQuery(".big-gallery > .gallery").carouFredSel({
        auto: true,
        items: 3,
        direction: "up",
        infinite: false,
        scroll: {
            items: 1,
            duration: 1e3,
            pauseDuration: 3e3,
            pauseOnHover: "immediate"
        }
    })

请求帮助!

1 个答案:

答案 0 :(得分:0)

它是你的逻辑,如果有更少的项目,你可以设置自动假,

var autoScroll=jQuery(".big-gallery > .gallery").length>3; // true only if items are more than 3
jQuery(".big-gallery > .gallery").carouFredSel({
    auto: autoScroll,// add this autoscroll here
    items: 3,
    direction: "up",
    infinite: false,
    scroll: {
        items: 1,
        duration: 1e3,
        pauseDuration: 3e3,
        pauseOnHover: "immediate"
    }
});
相关问题