An element was originally located above the bottom of the visible area of the screen. When the scroll bar scrolled up, the element touched the bottom of the screen. I want to trigger a function when the element touches the bottom of the screen. So how can I capture the element? What about touching the bottom of the screen?
The element turns red when it touches the bottom, otherwise it turns white
You can get the current scrollTop and the clientTop of the element through the js box model, and then make a judgment when the height of the box is known.