博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
swipejs的bug
阅读量:7092 次
发布时间:2019-06-28

本文共 1395 字,大约阅读时间需要 4 分钟。

Github:https://github.com/thebird/Swipe

以下bug的修复方式皆来自于网上。

现在最新的版本是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';    }}

 

以上代码来自于网上,只验证过前面两条。

转载于:https://www.cnblogs.com/samwu/p/4080220.html

你可能感兴趣的文章
Yii2 使用 faker 生成假数据(转)
查看>>
Consul安装使用
查看>>
tomcat事件处理机制
查看>>
JS BUG 传递数字过大,数据值会变化
查看>>
橡皮筋进度条ElasticProgressBar
查看>>
spring boot引入json,jsonobject,需要指定jdk15
查看>>
企业架构 - 涉众管理(Stakeholder Management)
查看>>
Ubuntu11.10 解决rar文件解压错误
查看>>
sqlplus: error while loading shared libraries: /u01/app/lib/libclntsh.so.11.1
查看>>
ORACLE等待事件:enq: TX - row lock contention
查看>>
使用Fiddler2录制HTTP操作脚本
查看>>
响应activex事件
查看>>
Winform 进程之间通讯的几种方法
查看>>
c++中冒号(:)和双冒号(::)的用法
查看>>
dubbo工作原理
查看>>
驱动开发利器Microsoft Windows Driver Kit 7.1.0下载
查看>>
maven_项目的依赖、聚合、继承
查看>>
一个C++类的注释:
查看>>
Winsock IO模型之select模型
查看>>
开发规范
查看>>