File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,7 @@ How to use
1515 .on('swiperight', function(){ /* ...* / })
1616 .on('swipeup', function(){ /* ...* / })
1717 .on('swipedown', function(){ /* ...* / });
18+
19+ This won't have any effect on non-touch devices. You can rely on:
20+
21+ $.fn.detectSwipe.enabled // true on touch devices, false otherwise
Original file line number Diff line number Diff line change 4747 this . addEventListener ( 'touchmove' , onTouchMove , false ) ;
4848 }
4949 }
50- if ( 'ontouchstart' in document . documentElement ) {
50+ if ( $ . fn . detectSwipe . enabled ) {
5151 this . addEventListener ( 'touchstart' , onTouchStart , false ) ;
5252 }
5353 } ) ;
5454
5555 return this ;
5656 } ;
57-
57+ $ . fn . detectSwipe . enabled = 'ontouchstart' in document . documentElement ;
5858} ) ( jQuery ) ;
You can’t perform that action at this time.
0 commit comments