微信按住说话HTML实现

直接看代码来得快:


<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />


<button id="hhhh">按住说话</button>

  <style type="text/css">
      #hhhh{height:40px;line-height: 40px; text-align: center; background: #f00; color:#fff;}
  </style>

  <script>
  document.getElementById('hhhh').addEventListener('touchstart', function(ev) {
           ev.preventDefault();
           this.style.background = '#f00';
           //your start record code here...
        }, false);
  document.getElementById('hhhh').addEventListener('touchend', function(ev) {
          ev.preventDefault();
           this.style.background  = '#0f0';
           //your stop record code here...
        }, false);

</script>


微信按住说话HTML实现

上一篇:微信支付的坑 返回值 -1


下一篇:微信公众平台自定义菜单