[英]about JavaScript help to implement fade-in and fade-out animation
const animation=document.querySelectorAll('.fade');
console.log(animation);
window.addEventListener("scroll",fadeIN);
function fadeIN()
{
for (let i=0; i<animation.length; i++)
{
let j=animation[i];
let height = j.getBoundingClientRect().top - window.innerHeight + 20;
if (height < 0) {
j.classList.add("visible");
} else {
j.classList.remove("visible");
}
}
}
fadeIN()
help me to change this logic帮我改变这个逻辑
let height = j.getBoundingClientRect().top - window.innerHeight + 20;
with simple JavaScript code with using web API libraries使用简单的 JavaScript 代码使用 web API 库
this javascipt code is about to fade-in fade-out animation code is working but i have to change this DOMreact code,let height = j.getBoundingClientRect().top - window.innerHeight + 20;此 javascipt 代码即将淡入淡出 animation 代码正在运行,但我必须更改此 DOMreact 代码,let height = j.getBoundingClientRect().top - window.innerHeight + 20; with simple javascript logic is it possible使用简单的 javascript 逻辑是否可能
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.