if ('ontouchstart' in document.documentElement) { //... } 转载于:https://www.cnblogs.com/zfdai/p/3624809.html