$swipeã§ã¹ã¯ã¤ãã¤ãã³ããæ¤åº AngularJSã®ngTouchã®$swipeãµã¼ãã¹ã«ã¯ã¹ã¯ã¤ãã¤ãã³ãã®start, move, cancel, endãå«ã¾ãã¦ãããå·¦ã¹ã¯ã¤ããå³ã¹ã¯ã¤ãã®ã¤ãã³ãã¯å«ã¾ãã¦ããªãã ãã®ããã¹ã¯ã¤ããæ¤åºããã«ã¯ã¢ã¸ã¥ã¼ã«ã追å ãããæ¤åºã§ããããã«ããããã®è¨è¿°ã追å ããå¿ è¦ãããã æéã¨ã¹ã¯ã¤ãè·é¢ã®åå¾ éå§æéã¨çµäºæéã¯touchstartã¨touchendã®ããããã®ã¿ã¤ãã³ã°ã§Date.now()ã使ç¨ãã¦ããªç§ãåå¾ã è·é¢ã¯touchstartã¨touchendã®xã¨yãåå¾ãã¦ä¸è¨ã®è¨ç®å¼ã§ã¹ã¯ã¤ãè·é¢ãç®åºããã dist = Math.sqrt(Math.pow(endX - startX, 2) + Math.pow(endY - startY, 2)); å·¦ã¹ã¯ã¤ãã¨å³ã¹ã¯ã¤ãã®å¤å® touchstartã®xä½
{{#tags}}- {{label}}
{{/tags}}