JS Mobile End Trigger event, JavaScript mobile end/Mobile End trigger event __js

Source: Internet
Author: User
Tags unique id

Handling Touch events allows you to track the position of each finger of the user. You can bind the following four kinds of touch events:

1 2 3 4 Touchstart://The finger on the screen when the trigger Touchmove://finger on the screen when the trigger touchend://finger from the screen when the trigger Touchcancel://System to cancel the touch of the event Time to trigger. As to when the system will be canceled, unknown
1 2 3 4 Client/clienty://Touch point relative to the position of the browser window viewport Pagex/pagey://Touch point relative to the position of the page Screenx/screeny://Touch point relative to the position of the screen identifier: Unique ID of the touch object



Http://blog.sina.com.cn/s/blog_65c2ec5e0101fexw.html
Handling Touch events allows you to track the position of each finger of the user. You can bind the following four kinds of touch events:     1.touchstart:  //  Fingers on the screen when the trigger        2.touchmove:  //  triggers       3.touchend:  //when the finger moves on the screen   When the finger is picked up from the screen, the trigger is triggered when the       4touchcancel:  //  system cancels the touch event. As to when the system will be canceled, the unknown property     1.client / clientY://  touch Point relative to the browser window viewport position       2.pageX / pageY://  position of touch point relative to page       3.screenx  /screenY://  location of the touch point relative to the screen       4.identifier: // touch object unique  ID //touchstart Events    Function touchsatrtfunc (e)  {        //evt.preventdefault ()  //prevents the browser from zooming, scrolling, and so on when touching        var touch  = e.touches[0]; //gets the first contact        var x = number ( Touch.Pagex);  //page contact x coordinates        var y = number (touch.pagey);  // Page contact y-coordinate        //record contact initial position        startX = x;        startY = y;  }  //touchmove events   function  touchmovefunc (e)  {       //evt.preventdefault ();  //prevents the browser from zooming when touching, scroll bar scrolling etc        var touch = evt.touches[0]; //get first Contact         var x = number (Touch.pagex);  //page Contact x coordinates         var y = number (touch.pagey);  //page Contact y-coordinate         var text =  ' Touchmove Event Trigger: ('  + x +  ',  '  + y +   ') ';       //to judge the sliding direction        if  (x -  startx != 0)  {           //sliding         }       if  (y - starty != 0)  {            //sliding        }  }     

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.