Skip to content

Commit 56af2ce

Browse files
committed
使用修正过的toucher组件
1 parent 4f09863 commit 56af2ce

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

asset/toucher.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @author 剧中人
33
* @github https://github.com/bh-lay/toucher
4-
* @modified 2015-3-7 01:02
4+
* @modified 2015-6-5 09:37
55
*
66
*/
77

@@ -142,8 +142,8 @@
142142
var newE = {
143143
'type' : name,
144144
'target' : e.target,
145-
'pageX' : touch.clientX || 0,
146-
'pageY' : touch.clientY || 0
145+
'pageX' : touch.pageX || 0,
146+
'pageY' : touch.pageY || 0
147147
};
148148
//为swipe事件增加交互初始位置及移动距离
149149
if(name.match(/^swipe/) && e.startPosition){
@@ -165,8 +165,7 @@
165165
* 判断swipe方向
166166
*/
167167
function swipeDirection(x1, x2, y1, y2) {
168-
return Math.abs(x1 - x2) >=
169-
Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
168+
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
170169
}
171170

172171
/**
@@ -321,4 +320,4 @@
321320
return function (dom){
322321
return new touch(dom);
323322
};
324-
});
323+
});

0 commit comments

Comments
 (0)