var hasTouch = window.matchMedia('(pointer: coarse)').matches;
if(hasTouch ){
//touch事件
}else{
//鼠标事件
}
var hasTouch = window.matchMedia('(pointer: coarse)').matches;
if(hasTouch ){
//touch事件
}else{
//鼠标事件
}
本文标题:js判断PC端与触摸屏(surface)PC端的区别
本文链接:https://www.haomeiwen.com/subject/orvduktx.html
网友评论