为了账号安全,请及时绑定邮箱和手机立即绑定

点击并点击保持操作在手机/Firefox Mobile Tester 中不起作用

点击并点击保持操作在手机/Firefox Mobile Tester 中不起作用

PHP
GCT1015 2023-10-21 20:02:22
我正在尝试更改 mousetap 上元素的不透明度或在 shopify 中按住元素,但它似乎不起作用。我添加了阻止默认设置,因为 grid-product__link 是一个链接<a href="url" class="grid-product__link is a link"><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>    <script>        $(document).ready(function() {          $('grid-product__link').on('taphold',function(event){    event.preventDefault;     $('.grid-product__secondary-image').css('opacity','1');    });       $('grid-product__link').on('tap',function(event){    event.preventDefault;      $('.grid-product__secondary-image').css('opacity','1');    });     });      </script><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mobile/1.4.1/jquery.mobile.min.js"></script>
查看完整描述

1 回答

?
喵喔喔

TA贡献1735条经验 获得超5个赞

event.preventDefault是一个函数。您只是将其作为值引用,而不是在代码中运行它。

代替,

event.preventDefault;

你应该做这个:

event.preventDefault();


查看完整回答
反对 回复 2023-10-21
  • 1 回答
  • 0 关注
  • 98 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信