File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @author 剧中人
3
3
* @github https://github.com/bh-lay/toucher
4
- * @modified 2015-3-7 01:02
4
+ * @modified 2015-6-5 09:37
5
5
*
6
6
*/
7
7
142
142
var newE = {
143
143
'type' : name ,
144
144
'target' : e . target ,
145
- 'pageX' : touch . clientX || 0 ,
146
- 'pageY' : touch . clientY || 0
145
+ 'pageX' : touch . pageX || 0 ,
146
+ 'pageY' : touch . pageY || 0
147
147
} ;
148
148
//为swipe事件增加交互初始位置及移动距离
149
149
if ( name . match ( / ^ s w i p e / ) && e . startPosition ) {
165
165
* 判断swipe方向
166
166
*/
167
167
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' )
170
169
}
171
170
172
171
/**
321
320
return function ( dom ) {
322
321
return new touch ( dom ) ;
323
322
} ;
324
- } ) ;
323
+ } ) ;
You can’t perform that action at this time.
0 commit comments