Github:https://github.com/thebird/Swipe
现在最新的版本是2.0,bug如下:
1.触摸后不会自动播放
修复方式,
function stop() {
//delay = 0;
delay = options.auto > 0 ? options.auto : 0;
clearTimeout(interval );
}
2.小于三个轮播元素,会多生成轮播元素
修复方式,
//Source codes:
if (browser.transitions && options.continuous && slides.length < 3) {
element.appendChild(slides[0].cloneNode(true));
element.appendChild(element.children[1].cloneNode(true));
slides = element.children;
}
//Modified codes:
//special case if two slides
if (browser.transitions && options.continuous && slides.length < 3) {
//element.appendChild(slides[0].cloneNode(true));
//element.appendChild(element.children[1].cloneNode(true));
//slides = element.children;
}
3.不同高度的轮播元素,矮的那位下面会有空白(为了布局稳定性,也不能说bug)
var height, heights = [];
function setup() {
//前面不变...
container.style.visibility = 'visible'; //在这之后加
container.style.height = slides[index].offsetHeight + 'px'; //修复不同高度之间的切换
}
function slide(to, slideSpeed) {
//前面不变...
offloadFn(options.callback && options.callback(index, slides[index])); //在这之后加
setHeight(to);
}
function setHeight(index) { //修复不同高度之间的切换
if (-1 < index && index < slides.length) {
height = slides[index].offsetHeight;
container.style.height = height + 'px';
}
}
612

被折叠的 条评论
为什么被折叠?



