Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #31398
| Subject | Re: Differentiate between touch start and click |
|---|---|
| Newsgroups | comp.lang.javascript |
| References | <I9SdnaAw9NE7MUbKnZ2dnUU7-VfNnZ2d@westnet.com.au> <1777691.oMNUckLgyt@PointedEars.de> |
| From | Andrew Poulos <ap_prog@hotmail.com> |
| Date | 2016-09-18 19:25 +1000 |
| Message-ID | <q_OdnYV7Q8DowEPKnZ2dnUU7-Y3NnZ2d@westnet.com.au> (permalink) |
On 17/09/2016 8:06 AM, Thomas 'PointedEars' Lahn wrote: > Andrew Poulos wrote: > >> I have a touchstart event and a click event both triggering this function > > You should not. AISB, “touchstart” is equivalent to “mousedown” and > “pointerdown”; ”click” is equivalent to “touchstart” followed by > “touchend”, or “pointerdown” followed by “pointerup”, instead. While they have been times I have pressed a button on my mouse only to change my mind before I release the button I have never touched a touch-enabled device and have changed my mind before I lifted my finger. So for me "touchstart" seems appropriate. >> To tell whether it was a touchstart or a click I'm using >> (e.type != "click") >> is that the right way to differentiate between the two or should I have >> two smaller functions (one for each event) which then pass on the >> relevant values to checkTrigger? > > No. No to which one: the former, the latter, or both? Andrew Poulos
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
Differentiate between touch start and click Andrew Poulos <ap_prog@hotmail.com> - 2016-09-16 18:26 +1000
Re: Differentiate between touch start and click Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-09-16 11:25 +0100
Re: Differentiate between touch start and click Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-17 00:06 +0200
Re: Differentiate between touch start and click Andrew Poulos <ap_prog@hotmail.com> - 2016-09-18 19:25 +1000
csiph-web