Click event in Iscroll under Mobile browser

Source: Internet
Author: User

H5 page of the product almost all use the Iscroll plug-in, if a tag in the Iscroll, in some mobile browsers, there will be no click, whether binding the Click event or using the A-tag href attribute. The href attribute is occasionally clickable, and the Click event is completely not available.

If you replace a with a button or input, you can respond to the click event.

If you are using a built-in browser, you can respond to the Click event (except Nubia). QQ Browser can also respond.

This is the problem with the phone's local browser, iscroll,a tags are related.

Iscroll uses various techniques to scroll based on device/browser capability. normally you don ' t need to configure the engine, Iscroll are smart enough to pick the best for you.

Don't be happy too soon.

Nonetheless it is important to understand which mechanisms iscroll works on and how to configure them.

There are too many options, just look at the focus, click and tap

To override the native scrolling iscroll have to inhibit some default browser behaviors, such as mouse clicks. If you want your application to respond to the click Event, you have a to explicitly set of this option to true . Please note that it's suggested to use the custom tap event instead (see below).

The point is here, Iscroll blocked the browser's default behavior, such as Click. Setting the Click to True is OK. Don't ask me why I blocked the default click, some mobile browser can be, some can not, this I do not know. - -。

If you only set Click to True, a partial a or no click will appear, plus taps:true;

Set this-to-let true iscroll emit a custom event when the scroll area is clicked/tapped and not tap scrolled.

Thanks to the Almighty StackOverflow,

Click event in Iscroll under Mobile browser

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.