Javascript animation (Hover) for Touch

Asked

Viewed 250 times

2

How can I make a Javascript animation that has CSS hover event, work for when the user uses touch on a mobile, for example.

My animation code does not work for Touch (Mobile). Which is my option?

  • 2

    Java or Javascript?

  • 1

    I edited your question deducing from the information provided that it is not Java and yes of Javascript. In case of disagreement, undo the edition.

1 answer

1


The behavior of mouse hover is not an expected event for Web Touch entries.

As cited here, events expected for Touch entries are:

Containing no reference to events of hover (which in literal translation would be: "hover over", which is not a feature available on most Touch screens) and for other specific events of mouse.

Completion: this is not a behavior expected by users who use Touch, so its functionality based on the event mouse hover is essential for its application and it has as target mobile devices and/or devices with Touch features, review the functionality to suit this new scenario.

References and reading suggestions:

  • 1

    Really, because if you stop to analyze the touch you have no way to put anything on top of a button, for example, and leave it there. You can press him only, and that’s where the events mentioned in the @Fernando reply

Browser other questions tagged

You are not signed in. Login or sign up in order to post.