建站知识搜索
|
Jquery 仿微信语音3022次浏览 |
2019-11-04 |
|
//语音 $("#voice").on({ touchstart: function(e) { // 长按事件触发 timeOutEvent = setTimeout(function() { timeOutEvent = 0; // alert('你长按了'); $("#voice").addClass('von'); }, 400); //长按400毫秒 // e.preventDefault(); }, /* touchmove: function() { clearTimeout(timeOutEvent); timeOutEvent = 0; },*/ touchend: function() { clearTimeout(timeOutEvent); if (timeOutEvent != 0) { $("#voice").addClass('von'); $.DialogByZ.Autofade({Title: "提示", Content:"说话时间太短",BtnL:"确定",Lurl:"",FunL:alerts}); setTimeout(function(){$("#voice").removeClass('von')},600); }else{ $.DialogByZ.Autofade({Title: "提示", Content:"说话结束"+timeOutEvent,BtnL:"确定",Lurl:"",FunL:alerts}); setTimeout(function(){$("#voice").removeClass('von')},1000); }//录音结束 return false; } }) //语音 页面所在本站地址: http://www.52-life.net/N_weixin_voice.htm |
上一篇 >>H5防止手机端弹出窗底层可滚动,解决手机端fixed穿透 |
下一篇 >>去除手机端长按文字复制功能 |
|
|
|