html5 滑动事件
来源:互联网 发布:淘宝模特招聘兼职 编辑:程序博客网 时间:2024/06/01 08:45
$(document).ready(function(){var startX,startY,endX,endYvar scrollTopVal=0; //左右滑动请自行修改//假定接受手指触摸事件的Dom对象id是"touchBox"document.getElementByIdx_x("touchBox").addEventListener("touchstart", touchStart, false);document.getElementByIdx_x("touchBox").addEventListener("touchmove", touchMove, false);document.getElementByIdx_x("touchBox").addEventListener("touchend", touchEnd, false);//里面getElementByIdx_x 中 x_x 是新浪自己加的,用的时候请去掉function touchStart(event){ var touch = event.touches[0]; startY = touch.pageY;}function touchMove(event){ var touch = event.touches[0]; endY = (startY-touch.pageY); if(scrollTopVal==0){$("#touchBox").scrollTop((endY+100));}else{ $("#touchBox").scrollTop(scrollTopVal+endY+100);} }function touchEnd(event){event.preventDefault();scrollTopVal=$("#touchBox").scrollTop();}});
0 0
- html5 滑动事件
- html5 手指触摸滑动事件
- HTML5滑动(swipe)事件
- HTML5滑动(swipe)事件
- Html5滑动事件,用于滑动分页
- Html5 移动端 触摸滑动事件
- html5 touch事件实现触屏页面上下滑动(一)
- html5 touch事件实现页面上下滑动 - Leinov
- 滑动事件左右滑动
- HTML5事件
- HTML5事件
- HTML5事件
- HTML5滑动的拼图游戏
- html5 页面滑动
- html5触摸滑动
- Android 屏幕滑动事件
- android滑动按钮事件
- Android 屏幕滑动事件
- 服务器设计、线程、代理线程的学习
- RESTful API 设计指南
- TCP通信流程解析
- UDP内网穿透讲解及代码实现、P2P
- java socket简单实现
- html5 滑动事件
- 第一章:初始化分析
- phonegap/cordova学习建议
- STL学习笔记之容器--deque(一)
- 每天一道算法题(13)——使用递归颠倒栈
- 动态加载js的方法
- 小知识点
- 网狐棋牌经典版管理后台操作手册
- 关于“政府和艺术”的GRE Issue原题