所以我找到了这个有用的 jQuery Content Carousel(http://tympanus.net/Development/CircularContentCarousel/),我一直在寻找它。
我修改了代码,将三个框显示为五个框: http://helpmyedu.com/test/
但是,当我单击“更多”时,我不知道在哪里修改 div 的宽度 - ca-content-wrapper,以便在单击“更多”时使其全宽!
感谢您的帮助!
已更新------------------------------------ 到目前为止,我已经设法显示扩展 元素显示正常,并关闭前三个 元素正确...
但是,当我关闭扩展项时,右边的最后两个 手边没有显示原始元素(请引用链接 对于我所说的)。
另外,当扩展窗口打开时,我有空格 尝试向左或向右导航....
请帮忙
最佳答案
在jquery.contentcarousel.js中,使用chrome developer或者Firebug,CTRL+F后找到ca-content-wrapper。
当你找到这个时,你就有了
openItem : function( $wrapper, $item, opts, cache ) {
cache.idxClicked = $item.index();
// the item's position (1, 2, or 3) on the viewport (the visible items)
cache.winpos = aux.getWinPos( $item.position().left, cache );
$wrapper.find('div.ca-item').not( $item ).hide();
$item.find('div.ca-content-wrapper').css( 'left', cache.itemW + 'px' ).stop().animate({
width : cache.itemW * 2 + 'px',
left : cache.itemW + 'px'
}, opts.itemSpeed, opts.itemEasing)
.end()
.stop()
.animate({
left : '0px'
}, opts.itemSpeed, opts.itemEasing, function() {
cache.isAnimating = false;
cache.expanded = true;
aux.openItems( $wrapper, $item, opts, cache );
});
},
你可以看到:
width : cache.itemW * 2 + 'px',
尝试在这个js文件上修改这个值。
关于javascript - jQuery 循环内容轮播 "ca-content-item"宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18998079/