CSS Mobile: implementation of acitve effect

Source: Internet
Author: User

Do mobile front-end also have some days, has a problem is not solved, is with the PC-like one: hover effect,: hover is the mouse pointer floating on its element of a selector, but because there is no mouse on the mobile side, instead of the touch screen, the user is not there " The mouse pointer floats on its element "case, there is also very little. So replace should: active this selector, but through the practice, found that the situation is not very ideal, in the QQ browser, sometimes triggered, there is no trigger, in my mx3 with from the browser has no effect.

Recently in the United States to see the H5 page when they do a good job (to tell the truth, the network in H5 this piece is really good), after reading their code, found that they are also used: active to achieve this effect, but they have a line of JS code,

function () { });

In fact, this line of code does not do anything, but the body is bound to a Touchstart event, and then did not do anything.

Since the practice of the discovery can be, the effect is really good. Like the American Regiment.

PS: On the mobile side of the browser will have a click on the highlight effect, you can pass to a tag or body,html plus

-webkit-tap-highlight-color:transparent;

All right.

CSS Mobile: implementation of acitve effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.