$(document).on('click','.a .b',function(){
var id=$(this).attr('id');
if(id){
window.location.href="{WEB_PATH}/mobile/mobile/item/"+id;
}
});
将click 改成 click touchstart
$(document).on('click touchstart','.a .b',function(){
var id=$(this).attr('id');
if(id){
window.location.href="{WEB_PATH}/mobile/mobile/item/"+id;
}
});
转载于:https://www.cnblogs.com/AbbyXie/p/11525908.html
本文介绍了一种在移动端网页中优化点击事件的方法,通过将click事件更改为clicktouchstart,可以提高用户体验和响应速度。文章提供了具体的jQuery代码示例,展示了如何实现这一改进。
185

被折叠的 条评论
为什么被折叠?



