JSFiddle - React, Tailwind, and code Playground
by uiwwnw
JavaScript
}
// return ctr;
// console.log(ctr)
// consoles.innerText=e[0].parentNode;
}
fn(el);
function check() {
// consoles.innerText=ctr;
if (!updown) {
nextIdx = idx + 1;
if (nextIdx > ctr.length - 2) nextIdx = ctr.length - 1;
console.log(ctr.length,idx, nextIdx);
if (ctr[nextIdx].parentTop > poY + windowHeight) {
idx = nextIdx;
}
// consoles.innerText=b;
} else {
nextIdx = idx - 1;
if (nextIdx < 0) nextIdx = 0;
console.log(nextIdx);
if (ctr[nextIdx].parentTop > poY + windowHeight) {
idx = nextIdx;
}
}
}