欢迎光临
我们一直在努力

将鼠标事件转换成移动设备触屏事件

            var    mousedown = "mousedown ";//鼠标按下
            var    mousemove = "mousemove ";//鼠标移动
            var    mouseup = "mouseup ";//鼠标抬起
            var  mouseout = "mouseout ";//鼠标移除
            var  mouse='PC';
            if (document.hasOwnProperty("ontouchstart") || 'ontouchstart' in window) {
                mousedown = "touchstart ";//手指按下
                mousemove = "touchmove ";//手指移动
                mouseup = "touchend ";//手指抬起
                mouseout = "touchcancel ";//手指移除
                mouse = 'YD';
            }

 

赞(0)
版权归原作者所有,如有侵权请告知。达维营-前端网 » 将鼠标事件转换成移动设备触屏事件

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址