Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jsでタッチデバイスの判定
// pcでユーザーエージェントを偽装されてアクセスされていても、これである程度判定できるはず
function isTouchDevice() {
return ($.browser.mobile && (('createTouch' in document) || ('ontouchstart' in document)) && ('orientation' in window));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment