htmlMobile page element press highlight
In the development process of mobile H5 page, there are often many clickable button/li/p and other elements, in order to influenceApplication User clicks, to increase the user experience, often need to manually add the press highlight effect.
Such as a series of list tags, you can click to respond or jump
<li>点击我的时候有按压高亮的效果</li> <li>点击我的时候有按压高亮的效果</li> <li>点击我的时候有按压高亮的效果</li>
The effect is as follows:
Implementation code
css li:active{ background-color:Color after pressing}
##js Trigger touch movement End Event
document.body.addEventListener('touchstart',function(){};)
thx
The above is the detailed content of HTML element press highlighting example description. For more information, please follow other related articles on the PHP Chinese website!