swiper 内容超出纵向滚动 解决办法
2016-06-23 11:32
393 查看
direction:'vertical',autoHeight:true
});
varstartScroll,touchStart,touchCurrent;
swiper.slides.on('touchstart',function(e){
startScroll=this.scrollTop;
touchStart=e.targetTouches[0].pageY;
},true);
swiper.slides.on('touchmove',function(e){
touchCurrent=e.targetTouches[0].pageY;
vartouchesDiff=touchCurrent-touchStart;
varslide=this;
varonlyScrolling=
(slide.scrollHeight>slide.offsetHeight)&&//allowonlywhenslideisscrollable
(
(touchesDiff<0&&startScroll===0)||//startfromtopedgetoscrollbottom
(touchesDiff>0&&startScroll===(slide.scrollHeight-slide.offsetHeight))||//startfrombottomedgetoscrolltop
(startScroll>0&&startScroll<(slide.scrollHeight-slide.offsetHeight))//startfromthemiddle
);
if(onlyScrolling){
e.stopPropagation();
}
},true);
来源:https://github.com/nolimits4web/Swiper/issues/1467
相关文章推荐
- windows下安装oracle,sqlplus连接启动oracle(oracle 主机字符串输入是什么)
- thinkphp nginx 配置
- Spring DI的配置使用
- Python reportLab 生成PDF
- mapper映射文件配置之insert、update、delete
- android sdk安装后出现location of the android sdk has not been setup in the preferences相关问题
- Redis与Memcached的区别
- 基于云模型的个性化推荐算法
- 第15章 图形
- sql 使用split 分隔自符串,进行循环
- 设计师测量文本行距
- Linux系统下如何使用SSD固态硬盘
- Linux虚拟地址空间布局
- Problem-C
- 【ImageView】android中src和background区别
- 开发者所需要知道的 iOS 10 SDK 新特性
- 【10】矩形覆盖
- Java Web基础
- Arduino SIM900 AT+CGATT=1 出错
- [leetcode] 347. Top K Frequent Elements