微信按住说话HTML实现

时间:2015-05-13 19:46:09   收藏:0   阅读:360

直接看代码来得快:


<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>


评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!