Javascript event fires on long press / tap on tablets

I am developing a website using RWD priciples, and it must be configured and work on both the desktop, tablets, and mobile phones.

I know that in Android development we can catch a long tap event and do some actions.

But my question is, is it possible to do this in HTML / HTML5 and javascript?

It basically searches for a predefined event that fires when the html elements are pressed for a long time.

I went through It and understood all the proposed alternatives. Looking if something new has been introduced in HTML5.
thanks

+4
source share
1 answer

You can check pointer.js from Mozilla. Apparently, somewhat standardizes touch / mouse events in one type of event. Probably better than using timeouts, I would imagine.

-one
source

Source: https://habr.com/ru/post/1498017/


All Articles