JS判断浏览器是否支持触屏事件,如果支持就调用

var hasTouch=function(){
        var touchObj={};
        touchObj.isSupportTouch = "ontouchend" in document ? true : false;
        touchObj.isEvent=touchObj.isSupportTouch?‘touchstart‘:‘click‘;
        return touchObj.isEvent;
    }

 

文章来自:http://www.cnblogs.com/mmdrs/p/4267437.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3