Mobile-Touch Events

Source: Internet
Author: User

Native Ontouchstart Ontouchmove ontouchend

Obj.addeventlistener (' Touchstart ', start)

Obj.addeventlistener (' Touchmove ', move)

Obj.addeventlistener (' Touchend ', end

<a> Click Me </a>

<div>abc</div>

Div{position:absolute;left:0;top:0;background: #ff0000;}

Events on the mouse can be used on the mobile side, but events on the mouse are deferred over the touch class event on the mobile side, about 300MS

Mobile event (TAP), when the user triggers a similar click event, the upper element disappears or hides, because click has 300ms, the target point will "drift" after 300ms, if the target point has a click event (Focus event) then it will trigger

Solution: Obj.addeventlistener (' Touchstart ', function (EV) {

Ev.preventdefault ()//block default behavior

})

If need jump can pass window.location.href= "url";

Itools Apple recording screen master (mobile phone side debugging)

IOS10 set the meta will still zoom

Mobile-Touch Events

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.