因为项目中需要一个旋转木马式的轮播,所以网上找了一个插件,本来挺符合项目需求的,但是不知怎么的滚动时有时会出现顺序问题,demo代码在这:
http://jsbin.com/gafodanava/e...
效果在这
http://output.jsbin.com/gafod...
当点击下一个时,有时会顺时针式的跳转,但有时又会交错式的跳转
看了一下代码,其中
carouselRotate: function(dir) {
...
self.animate({ //xxx
width: width,
height: height,
//zIndex:zIndex,
opacity: opacity,
left: left,
top: top
},
_this_.setting.speed,
function() {
_this_.rotateFlag = true;
});
});
发现是用animate方法控制移动的,但不知发生跳转问题的原因是什么?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
看了一下,顺序是对的,之所以会出现交错跳转,是因为
z-index没有控制好,让人产生错觉。再看看你贴的代码,应该是 被注释掉的
zIndex:zIndex的问题。