I
I
IvanKalinin2015-03-20 09:34:36
css
IvanKalinin, 2015-03-20 09:34:36

How to implement hover effect on mobile devices?

there is such a layout with a hover effect in the upper right block.
for this effect to work on a mobile device, an ontouchstart event has been added:

<div class="col-sm-4 col-sm-offset-8 flip-container" ontouchstart="this.classList.toggle('hover');">

The problem is that the effect only works in one direction only on the first tap, i.e. the text does not return back and it is useless to tap on the screen.
What is the problem - I could not find it, can someone tell me? the feeling that it does not work out the second and subsequent times toggle

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Gavrilenko, 2015-03-20
@Maddox

Well, do another ontouchend
PS: that's the idea, with each tap the effect should change.

G
Gluck Virtualen, 2015-03-22
@gluck59

For mobile devices, the behavior of the element will have to be redone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question