[Go to]ios Safari Click to click on event invalidation Solution

Source: Internet
Author: User

The solution to the click-click event Invalidation in IOS Safari cause: Click event clicked Invalid (unable to execute) problem description with jquery Live method during public number development (micro station)

When a delegate is used to add an event to an element, the event click is invalidated if the event is delegated to document or body on, and the element of the delegate is not clickable by default (such as div , span etc.) click .

Solutions

There are 4 solutions to choose from:

    1. ? click bind the event directly to the target? IE .target ) on
    2. Change the target element to <a> a clickable element button ?
    3. ? click delegate events to????? Non- document or body the?? On the parent element
    4. Add a style rule to the target elementcursor: pointer;

? recommend the latter two. From the perspective of the solution, it is speculated that in Safari, a click event of a non-clickable element does not bubble to the parent element. By adding, the cursor: pointer element becomes clickable.

Reference: https://happycoder.net/solve-ios-safari-click-event-bug/

[Go to]ios Safari Click to click on event invalidation Solution

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.