Created
August 21, 2013 02:55
-
-
Save leohxj/6289879 to your computer and use it in GitHub Desktop.
原生JS判断是否支持触摸屏
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 SupportsTouches = ("createTouch" in document); | |
var default = { | |
StartEvent : SupportsTouches ? "touchstart" : "mousedown",//支持触摸式使用相应的事件替代 | |
MoveEvent : SupportsTouches ? "touchmove" : "mousemove", | |
EndEvent : SupportsTouches ? "touchend" : "mouseup" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment