微信按住说话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>


文章来自:http://blog.csdn.net/wujiangwei567/article/details/45696441
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3