preventDefault()的方法,阻止事件的默认行为。

在移动端,手指点击一个元素,会经过:touchstart --> touchmove -> touchend -->click。

$("#largeImg").on("touchstart",function(e){
   e.preventDefault();
    $("#largeImg").css("display","none");
   $(_thisImg).removeClass("active");
});

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案