Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/464.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
圆形滑块图像控件javascript_Javascript_Jquery_Html_Css - Fatal编程技术网

圆形滑块图像控件javascript

圆形滑块图像控件javascript,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我已经使用了这个网站的圆形滑块,我只需要在旋转器中显示三个图像。如果我使用了7个以上的图像,旋转器中有5个图像。可以有任意数量的图像,但旋转器中应显示三个。如何解决这个问题 脚本: (function($) { var $descriptions = $('#carousel-descriptions').children('li'), $controls = $('#carousel-controls').find('span'), $carousel = $('#carou

我已经使用了这个网站的圆形滑块,我只需要在旋转器中显示三个图像。如果我使用了7个以上的图像,旋转器中有5个图像。可以有任意数量的图像,但旋转器中应显示三个。如何解决这个问题

脚本:

(function($) {

var $descriptions = $('#carousel-descriptions').children('li'),
    $controls = $('#carousel-controls').find('span'),
    $carousel = $('#carousel')
        .roundabout({childSelector:"a", minOpacity:1, autoplay:true, autoplayDuration:5000, autoplayPauseOnHover:true })
        .on('focus', 'a', function() {
            var slideNum = $carousel.roundabout("getChildInFocus");

            $descriptions.add($controls).removeClass('current');
            $($descriptions.get(slideNum)).addClass('current');
            $($controls.get(slideNum)).addClass('current');

        });

$controls.on('click dblclick', function() {
    var slideNum = -1,
        i = 0, len = $controls.length;

    for (; i<len; i++) {
        if (this === $controls.get(i)) {
            slideNum = i;
            break;
        }
    }

    if (slideNum >= 0) {
        $controls.removeClass('current');
        $(this).addClass('current');
        $carousel.roundabout('animateToChild', slideNum);
    }
});

}(jQuery));
(函数($){
变量$descriptions=$('#carousel descriptions')。子项('li'),
$controls=$(“#转盘控件”)。查找('span'),
$carousel=$(“#carousel”)
.roundout({childSelector:“a”,最小容量:1,自动播放:true,自动播放持续时间:5000,自动播放暂停悬停:true})
.on('focus','a',function(){
var slideNum=$carousel.roundout(“getChildInFocus”);
$descriptions.add($controls.removeClass('current');
$($descriptions.get(slideNum)).addClass('current');
$($controls.get(slideNum)).addClass('current');
});
$controls.on('click dblclick',function(){
var slideNum=-1,
i=0,len=$controls.length;
对于(;i=0){
$controls.removeClass('current');
$(this.addClass('current');
$carousel.roundout('animateToChild',slideNum);
}
});
}(jQuery));

请查看我编辑的问题。还需要查看HTML吗