0
后来,我为需要编号活动状态的客户端实现了jCarousel图像解决方案。经过一番搜索后找到了答案,但注意到首选的循环选项不起作用。jCarousel - 实现活动状态并包装:循环
会发生什么情况是,一旦旋转木马已经遍历所有(5)图像,在返回到第一个图像时,活动状态将会丢失,因为根据jcarousel它实际上是第6个不断增加)。
我只是继续前进,而是用wrap:'both',它至少有一个正常工作的活动状态。但是现在客户说他们不喜欢这种效果,只想让动画在最终图像后返回到位置1。这意味着我需要得到'wrap':'都'以某种方式工作。
下面是我目前的代码。有人可以解决这个问题,因为它有点高于我的头!
function highlight(carousel, obejctli,liindex,listate){
jQuery('.jcarousel-control a:nth-child('+ liindex +')').attr("class","active");
};
function removehighlight(carousel, obejctli,liindex,listate){
jQuery('.jcarousel-control a:nth-child('+ liindex +')').removeAttr("class","active");
};
jQuery('#mycarousel').jcarousel({
initCallback: mycarousel_initCallback,
auto: 5,
wrap: 'both',
vertical: true,
scroll: 1,
buttonNextHTML: null,
buttonPrevHTML: null,
animation: 1000,
itemVisibleInCallback: highlight,
itemVisibleOutCallback: removehighlight
});
});
在此先感谢
感谢Duopixel。我把这一个交给了一位同事,她提出了和你一样的答案。 干杯。 – swisstony 2011-02-13 08:13:35