0

我已经设置了垂直自动滚动条。

[由neuroflux编辑]当我处于“循环”模式时出现问题 - 到达轮播的结束或开始,它只是一遍又一遍地重复相同的幻灯片。[/编辑]

.jcarousel-skin-tango .jcarousel-container {

        }

        .jcarousel-skin-tango .jcarousel-direction-rtl {
            direction: rtl;
        }

        .jcarousel-skin-tango .jcarousel-container-horizontal {
            width: 245px;
            padding: 20px 40px;
        }

        .jcarousel-skin-tango .jcarousel-container-vertical {
            width: 75px;
            height: 245px;
            padding: 40px 20px;
        }
        .jcarousel-skin-tango .jcarousel-clip {
            overflow: hidden;
        }

        .jcarousel-skin-tango .jcarousel-clip-horizontal {
            width:  245px;
            height: 75px;
        }

        .jcarousel-skin-tango .jcarousel-clip-vertical {
            width:  75px;
            height: 245px;
        }

        .jcarousel-skin-tango .jcarousel-item {
            width: 75px;
            height: 75px;
        }

        .jcarousel-skin-tango .jcarousel-item-horizontal {
            margin-left: 0;
            margin-right: 10px;
        }

        .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal {
            margin-left: 10px;
            margin-right: 0;
        }

        .jcarousel-skin-tango .jcarousel-item-vertical {
            margin-bottom: 10px;
        }

        .jcarousel-skin-tango .jcarousel-item-placeholder {
            background: #fff;
            color: #000;
        }

javascript

function mycarousel_initCallback(carousel)
            {
                // Disable autoscrolling if the user clicks the prev or next button.
                carousel.buttonNext.bind('click', function() {
                    carousel.startAuto(0);
                });

                carousel.buttonPrev.bind('click', function() {
                    carousel.startAuto(0);
                });

                // Pause autoscrolling if the user moves with the cursor over the clip.
                carousel.clip.hover(function() {
                    carousel.stopAuto();
                }, function() {
                    carousel.startAuto();
                });
            };
            jQuery('#carousel').jcarousel({
                auto: 2,
                wrap: 'circular',
                vertical: true,
                initCallback: mycarousel_initCallback
            });

这样做有什么原因吗?我在li项目中添加了宽度和高度,但我不知道为什么它不起作用

4

1 回答 1

0

试试这个代码

$('ul#carousel').jcarousel({
    auto:true,
    scroll:1,  //this number must less than the number of list item you have
    visible:2, //this number must less than the number of list item you have
    vertical: true,
    wrap: 'last',
    initCallback: mycarousel_initCallback
    });
于 2013-06-23T02:08:43.650 回答