HTML element press highlighting example description

高洛峰
Release: 2017-03-13 14:46:05
Original
1866 people have browsed it

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

The effect is as follows:

html元素按压高亮示例说明

Implementation code

  1. css li:active{ background-color:Color after pressing}

  2. ##js Trigger touch movement End Event

       document.body.addEventListener(&#39;touchstart&#39;,function(){};)
    Copy after login
    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!

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