L
L
lilandre2018-06-28 14:49:21
JavaScript
lilandre, 2018-06-28 14:49:21

Is there an event in javascript that sees that this particular part of the page is currently displayed in the browser?

Good afternoon. It is required to perform an action when the browser screen is on a certain part of the site page. For example, when you scroll on Habré to the heading - "MOST READ", the event fires and the function is executed. Is that possible ?
5b34ca4719b79242657524.png
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Proskurin, 2018-06-28
@lilandre

Watch the onscroll event, and when its Y coordinate is greater than the Y coordinate of the desired block, then we have scrolled.

D
Dmitry Belyaev, 2018-06-28
@bingo347

https://developer.mozilla.org/en/docs/Web/API/Inte...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question