This just requires setting a delay, commonly known as function throttling. That is, when a scroll event occurs, the image is not loaded immediately, but is delayed for a while. If there is a new scroll event during this period, the loading action of the previous event will be canceled.
Detect the distance between the top of the image container and the top of the browser window (if(offsetTop<0){**}). The computer is not nearby, so I don’t have an example for you. Please help me write it down.
This just requires setting a delay, commonly known as function throttling. That is, when a scroll event occurs, the image is not loaded immediately, but is delayed for a while. If there is a new scroll event during this period, the loading action of the previous event will be canceled.
Detect the distance between the top of the image container and the top of the browser window (if(offsetTop<0){**}). The computer is not nearby, so I don’t have an example for you. Please help me write it down.