读书人

求推荐 jquery 支持触屏 事件 的插件

发布时间: 2013-11-06 16:26:37 作者: rapoo

求推荐 jquery 支持触屏 事件 的插件
求推荐 jquery 支持触屏 事件 的插件
如:
触摸事件
ontouchstart
ontouchmove
ontouchend
ontouchcancel
[解决办法]
jquery mobile
[解决办法]
楼主你可以这样

//适应触控设备
function eventAdapt(){
mousedown = "mousedown ";
mousemove = "mousemove ";
mouseup = "mouseup ";
mouseout= "mouseout ";
if ('ontouchstart' in window) {
mousedown = "touchstart ";
mousemove = "touchmove ";
mouseup = "touchend ";
mouseout= "touchcancel ";
}
}

读书人网 >JavaScript

热点推荐