Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.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 有没有可能让环岛在前面显示5个元素而不是3个元素?_Javascript_Jquery_Jquery Roundabout - Fatal编程技术网

Javascript 有没有可能让环岛在前面显示5个元素而不是3个元素?

Javascript 有没有可能让环岛在前面显示5个元素而不是3个元素?,javascript,jquery,jquery-roundabout,Javascript,Jquery,Jquery Roundabout,我正在使用Roundound插件作为一个无限的滑块,它会不断地旋转。问题是我想在一行中显示5个元素,而不是3个。有可能实现吗?也许有人试过这样的东西 这就是我目前所拥有的 ul { list-style: none; padding: 0; margin: 0 auto; width: 970px; height: 350px; } li { text-align: center; cursor: pointer; } li img {

我正在使用Roundound插件作为一个无限的滑块,它会不断地旋转。问题是我想在一行中显示5个元素,而不是3个。有可能实现吗?也许有人试过这样的东西

这就是我目前所拥有的


ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    width: 970px;
    height: 350px;
}
li {
    text-align: center;
    cursor: pointer;
}
li img {
    max-width:100%;
    max-height:100%;
}

.monolith{
    text-align: center;
    position: absolute;
    opacity: 1;
    min-height: 300px;
    min-width: 1200px;
    top: 0px;
    left: 0px;
    background: red;
    z-index: 20;
}
你试过了吗?名为“图8”的形状在一行中显示5个项目,尽管动画有点奇怪

<script>
   $(document).ready(function() {
      $('ul').roundabout({
         shape: 'figure8'
      });
   });
</script>

$(文档).ready(函数(){
$('ul')。环岛({
形状:“图8”
});
});

您还可以编写自己的形状:

$(function () {
    jQuery.extend(jQuery.roundaboutShapes, {
        gimmeFive: function(r, a, t) {  
            return {
                // Source: http://smartecharts.aftrix.com/carousel/index.html
                x: (Math.sin(r)>0) ? Math.sin(r/2) : Math.sin(r/2 + Math.PI), 
                y: (Math.sin(r + 3*Math.PI/2 + a) / 8) * t, 
                z: (Math.cos(r + a) + 1) / 2,
                scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5                
            };
        }
    });

    $('ul').roundabout({
        minZ: 19, // This value puts the 6th item behind the red <div> 
        maxZ: 30,
        minOpacity: 1,
        minScale: 0.1,
        shape: 'gimmeFive'
    });
});
$(函数(){
extend(jQuery.roundoutshapes{
框架五:函数(r,a,t){
返回{
//资料来源:http://smartecharts.aftrix.com/carousel/index.html
x:(Math.sin(r)>0)?Math.sin(r/2):Math.sin(r/2+Math.PI),
y:(Math.sin(r+3*Math.PI/2+a)/8)*t,
z:(数学cos(r+a)+1)/2,
量表:(Math.sin(r+Math.PI/2+a)/2)+0.5
};
}
});
$('ul')。环岛({
minZ:19,//此值将第6项放在红色后面
马克斯:30,
产能不足:1,
最小刻度:0.1,
形状:“gimmeFive”
});
});
结果:


是的,我试过了。动画是问题所在。这很奇怪。
$(function () {
    jQuery.extend(jQuery.roundaboutShapes, {
        gimmeFive: function(r, a, t) {  
            return {
                // Source: http://smartecharts.aftrix.com/carousel/index.html
                x: (Math.sin(r)>0) ? Math.sin(r/2) : Math.sin(r/2 + Math.PI), 
                y: (Math.sin(r + 3*Math.PI/2 + a) / 8) * t, 
                z: (Math.cos(r + a) + 1) / 2,
                scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5                
            };
        }
    });

    $('ul').roundabout({
        minZ: 19, // This value puts the 6th item behind the red <div> 
        maxZ: 30,
        minOpacity: 1,
        minScale: 0.1,
        shape: 'gimmeFive'
    });
});