M
M
Maxim js2019-11-09 15:55:54
css
Maxim js, 2019-11-09 15:55:54

How to implement a type of hover effect on click on touch screens?

Currently on mobile, when clicked, it immediately goes to the link.
here is the site geekend.ru I want to make it so that I poked once a hint came out, poked the second one followed the link (namely on touch screens)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Oksenchuk, 2019-11-09
@Yevhen89

It's easy, put a condition in the javascript that if there is such a class, then there is a transition, if this class does not exist, then add it)
function foo(e)
if (el.classList.contains('hover')) {
} else {
e .preventDefault
el.classList.add('hover')
}
something like this can be done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question