jquery 手机浏览器 click事件无效

默认情况下jquery的click是OK的,但是跟有些html5游戏代码一混起来就不行了。解决方案:

 $("#element").bind("mousedown touchstart", function(event){
event.stopPropagation();
event.preventDefault();
       //do something
     
    });

同时注册mousedown和touchstart事件。
1752

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.