Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31385

Re: Differentiate between touch start and click

Path csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Differentiate between touch start and click
Date Sat, 17 Sep 2016 00:06:50 +0200
Organization PointedEars Software (PES)
Lines 21
Message-ID <1777691.oMNUckLgyt@PointedEars.de> (permalink)
References <I9SdnaAw9NE7MUbKnZ2dnUU7-VfNnZ2d@westnet.com.au>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1474063611 28584 eJwNysEBwCAIA8CVoJIg4yDC/iPYex8WleVG0DCYgG9qO1S98N2z+ubIboiO8EhacLL9P1HgAw7RENw= (16 Sep 2016 22:06:51 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Fri, 16 Sep 2016 22:06:51 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwFwQkBwDAIA0BLYZRQ5PAU/xJ2Z0ph+6Hx2NrWeME73MEVAK8jsuZO4ZPS1GbCR1KsCyB7N+Lx5c02/l3VFg4=
Cancel-Lock sha1:GfbTNIXEoWE9NAkkZGf5dPHYjKU=
X-NNTP-Posting-Host eJwVx8kRwDAIBLCWTGA5yglr6L+ETPQT1MUZ5nDDYo/aJUedEtnJrPNv0CuPlQRascp5T2/U/QAffRFn
Xref csiph.com comp.lang.javascript:31385

Show key headers only | View raw


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.

> 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.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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