longPressRecording
功能描述
仿微信发送语音效果,按下向上滑动动录音图标可取消,用例见 longPressRecording.html
依赖的模块
./libs/longPressRecording.css
./libs/longPressRecording.js
快速使用
引入模块文件
<link rel="stylesheet" type="text/css" href="./libs/longPressRecording.css"/>
<script src="./libs/longPressRecording.js" type="text/javascript" charset="utf-8"></script>
使用以下DOM将会自动绑定长按事件
<div class="btn">
<input type="button" id="bt_recoding" value="按住 说话">
</div>
<div class="blackBoxSpeak">
<p class="blackBoxSpeakConent">手指上划,取消发送</p>
</div>
<div class="blackBoxPause">
<p class="blackBoxPauseContent" style="background: red">松开手指, 取消发送</p>
</div>