Share 6 articles about pointer properties

Source: Internet
Author: User
Actually knew this attribute earlier, but has not been studied. Today just on Twitter to see the word, went to study the next, just solve the current encounter a small problem, so share under. Well, actually this is a relatively simple CSS3 property. Take a look at my detailed description of the pointer property.

1. Using CSS pointer-events properties to achieve the mouse penetration effect of the skills to share

First, is an East Mall product List page of goods, in the upper right corner there is a "breaking price" icon, we all know that this is a label in the absolute positioning up, will cover the following product image, the mouse moved to the "breaking price" picture is not click on the image of the link, of course, we can also add links to this icon, This will solve the problem. (Today is not a simple thing to say oh, we continue)

The scope of responsibility of CSS in modern browsers and the blurring of JavaScript are unclear. For example, CSS in the-webkit-touch-callout property in iOS can prohibit when the user clicks the pop-up bubble box. The pointer-events style that this article is talking about is more like JavaScript, which can:

1. Prevent user's Click action to produce any effect
2. Prevent the default mouse pointer from appearing
3. Prevent hover and active state changes in CSS from triggering events
4. Blocking events triggered by JavaScript click Actions
A CSS property can do all of this with so many things!

2. CSS change mouse for hand style introduction

In a self-setting p or other tab, for a better experience, the mouse will be turned into a gesture during the swipe process.

A simple summary of the CSS corresponding to the style.

In the P, add cursor:pointer.

3. Weird behavior of pointer-events attributes in CSS _html/css_web-itnose

In my memory pointer-events is used for event penetration, that is, if the parent element is set to Pointer-events:none, then the parent element no longer listens for mouse event events (similar to Touch,click).

The need to do this is usually when we want to "penetrate" the parent layer, and when the child element is clicked directly, the parent element is treated as if nothing has happened. This is the information collected in my previous knowledge system. There is nothing wrong with it now, but it is not complete.

4. CSS screen element mouse event Pointer-events_html/css_web-itnose

Shielded click

$ (' body '). CSS (' pointer-events ', ' none ');

Restore default

$ (' body '). CSS (' pointer-events ', ' auto ');

Useful: You can set mouse events for the following elements when the popup layer or fixed positioning

5. Magical CSS Properties Pointer-events_html/css_web-itnose

When an absolutely positioned element covers a link or adds an element of an event handle, the link's default behavior (page jump) or element event will not be triggered.
Now Firefox3.6+/safari4+/chrome supports a CSS property called Pointer-events. Use this property to determine whether an absolutely positioned element can be penetrated to trigger some behavior of the following element

6. Cursor mouse style?? Property _html/css_web-itnose

We are in the div CSS layout, we will encounter the object within the mouse pointer cursor control, such as the mouse pointer changes to the shape of the finger style, next we introduce the mouse pointer style cursor control. The system default mouse pointer style outside, you can set the picture through the CSS mouse pointer, common some Web site mouse pointer is a variety of small picture style, of course this is the mouse style through CSS cursor settings.

Questions and answers about pointer properties:

1. Questions about CSS3 Pointer-events:none; attributes

2. Objective-c-Rac:incompatible block pointer types sending

"Recommended"

1. php.cn Lonely Nine-base (2)-css video tutorial

2. CSS pointer control code to display the hand type in Firefox basic tutorial

Related Article

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.