Home > Web Front-end > HTML Tutorial > WeChat press and hold to speak HTML implementation_html/css_WEB-ITnose

WeChat press and hold to speak HTML implementation_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:44:28
Original
1270 people have browsed it

It’s faster to look at the code directly:


<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>
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template