Created
August 21, 2013 02:52
-
-
Save leohxj/6289870 to your computer and use it in GitHub Desktop.
使用Modernizr检测触摸/点击事件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isTouch = Modernizr.touch; | |
var defaults = { | |
name: "range", | |
tapGesture: isTouch ? "tap" : "click", | |
startGesture: isTouch ? "touchstart" : "mousedown", | |
moveGesture: isTouch ? "touchmove" : "mousemove", | |
stopGesture: isTouch ? "touchend touchcancel" : "mouseup", | |
hoverGesture: isTouch ? "touchstart" : "mouseover" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment