Solve the problem that the click event is not triggered on the iPhone.

Source: Internet
Author: User

 

Solve the problem that the click event is not triggered on the iPhone.

 

 

// There is such an event on ID jsprovince:
            $(‘body‘).on(‘click‘, ‘#jsProvince‘, function(e){                $(this).next(‘.province-list‘).removeClass(‘hide‘);            });

However, clicking on the iPhone does not respond, and you cannot bind a click event.

However, there is no problem in testing on Android.

 

After searching for half a day, I finally found a solution:

You only need to add the following CSS style to the element whose ID is jsprovince:

#jsProvince{   cursor: pointer;}

 

 

You can click it normally. It's amazing. The answer is incredibly simple:Just set the CSScursor: pointer.

 

Refer:

Http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript

Http://stackoverflow.com/questions/3705937/document-click-not-working-correctly-on-iphone-jquery

 

 

 

 

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.