let totalHeight = 0;.md
let totalHeight = 0;
let distance = 1000;
let timer = setInterval(() => {
let scrollHeight = document.body.scrollHeight;
window.scrollBy(0, distance);
totalHeight += distance;
if (totalHeight >= scrollHeight - window.innerHeight) {
clearInterval(timer);
console.log("خلص التحميل");
}
}, 1000);
Leave a Comment