以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]在JS中按住不放事件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=146347)

--  作者:baiyang
--  发布时间:2020/2/21 19:25:00
--  [求助]在JS中按住不放事件

document.getElementById(\'bt1\').on(\'touchstart\',function(event){
      alert(\'1\')
            event.preventDefault();
              START = new Date().getTime();
             
              recordTimer = setTimeout(function(){
                wx.startRecord({
                      success: function(){
                          localStorage.rainAllowRecord = \'true\';
                          $("#start").css("display","block");
                      },
                      cancel: function () {
                          $("#start").css("display","block");
                          $("#start").html("用户拒绝授权录音");
                      }
                  });
              },300);
          });

百度复制代码怎么不生效,还要改那些地方么,按键长按就跳出复制,全选文字了


--  作者:有点蓝
--  发布时间:2020/2/21 20:57:00
--  
on是jQuery才有的绑定事件用法,html控件本身是没有的,
$(\'#bt1\').on(\'touchstart\',function(event){

[此贴子已经被作者于2020/2/21 20:56:57编辑过]