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
function isFunction(obj) { | |
return obj && {}.toString.call(obj) === '[object Function]'; | |
} |
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
// Check if device is mobile | |
function isMobileDevice() { | |
return /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent); | |
} | |
// Check if device is touchable | |
function isTouchDevice() { | |
return 'ontouchstart' in document.documentElement; | |
} |
NewerOlder