F
F
fajiz2017-05-13 02:46:28
JavaScript
fajiz, 2017-05-13 02:46:28

How to track the "touch" of elements on the page?

An example can be seen here, on the left side of the likes panel. When the page is scrolled from bottom to top and a full-screen image appears on the horizon, this panel disappears. https://rantt.com/heres-every-moment-that-shaped-t...
How to add a class to such an event? What to track?
Interested in how it is in vanilla JS or a ready-made bible for Vue.
jQuery etc is not needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Fedortsev, 2017-05-13
@a1exFed

In your example, it's not the "touch" that's being tracked, but the change in window.scrollY - increasing margin-top: -100%, decreasing margin-top: 100%.
If you know the basics of JS, you can write ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question