function setLayout() {
// 각 스크롤 섹션의 높이 세팅
for (let i = 0; i < sceneInfo.length; i++) {
if (sceneInfo[i].type === 'sticky') {
sceneInfo[i].scrollHeight = sceneInfo[i].heightNum * window.innerHeight;
} else if (sceneInfo[i].type === 'normal') {
sceneInfo[i].scrollHeight = sceneInfo[i].objs.content.offsetHeight + window.innerHeight * 0.5;
}
sceneInfo[i].objs.container.style.height = `${sceneInfo[i].scrollHeight}px`;
}
yOffset = window.pageYOffset;
let totalScrollHeight = 0;
for (let i = 0; i < sceneInfo.length; i++) {
totalScrollHeight += sceneInfo[i].scrollHeight;
if (totalScrollHeight >= yOffset) {
currentScene = i;
break;
}
}
document.body.setAttribute('id', `show-scene-${currentScene}`);
여기서 컨텐츠 증가 또는 해당하는 섹션에서만 동작하게 하고싶은데 아무리 수정해봐도 잘 모르겠습니다.
몇가지 씬을 지워버리면 아예 동작을하지 않는 현상도 있구요
* 궁금한사항은 scroll-section-0이 중간쯤 있을때, show-scene-0 을 추가하고 다시 올라갔을때 없애고 싶습니다.