127th Day: Mobile-Get the location of the touch point

Source: Internet
Author: User

description of how to get touch points on the mobile side1.TouchstartEvent Finger Touch Event 2 on the screen.TouchmoveFinger swipe on the screen to trigger event 3.TouchendTriggering the use of jquery when the finger is left on the screen is as follows: $ ("#demoid"). Bind (' Touchstart ', function () {//code processing});Touchstart, Touchmove, touchend three kinds of events under the mouse position point gets:(1)TouchstartEvent is obtained under:E.originalevent.targettouches[0].pagexDescription: Because the finger is multi-touch to the screen of us so e.originalevent.targettouches means a finger touch point set we just need to get the first point on it so e.originalevent.targettouches[ 0], so position. PageX. Pagey is ok (2)TouchendGet the event:E3.originalevent.changedtouches[0].pagexHere are some other introductions: Each Touch object contains the following attributes. ClientX: Touch the x-coordinate of the target in the viewport. ClientY: Touch the y-coordinate of the target in the viewport. Identifier: Identifies the unique ID of the touch. PageX: Touch the x-coordinate of the target in the page. Pagey: Touch the y-coordinate of the target in the page. ScreenX: Touch the x-coordinate of the target in the screen. ScreenY: Touch the y-coordinate of the target in the screen. Target: Touch the destination DOM node targets.

127th Day: Mobile-Get the location of the touch point

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.