인프런 커뮤니티 질문&답변
선생님 이부분 질문있습니다.
작성
·
226
0
type:'sticky',
//2
heightNum:5,
scrollHeight:0,
objs:{
container: document.getElementById('scroll-section-2')
}
},
{
type:'sticky',
//3
scrollHeight:0,
heightNum:5,
objs:{
//container: document.querySelector('#scroll-section-3')
container: document.getElementById('scroll-section-3')
}
}
];
function setLayout(){
for(let i=0; i<sceneInfo.length; i++){
sceneInfo[i].scrollHeight = sceneInfo[i].heightNum * window.innerHeight;
sceneInfo[i].objs.container.style.height=sceneInfo[i].scrollHeight;
//기본적으로 문자열을 설정해야하나 ${--- } << ---이부분에 변수이름을 적용 가능
}
console.log(sceneInfo);
}
setLayout();
})();
주석과는 관계 없이 getelementbyid 로 id객체를 가져와서 그 객체에 style.height로 값을 저런식으로 주게되면 왜 적용이 안되는건가요?
퀴즈
강의에서 소개된 스크롤 애니메이션 구현 방식에서, 애니메이션 진행 상태를 결정하는 주요 요소는 무엇일까요?
시간(Time)
스크롤 값(Scroll Value)
마우스 움직임(Mouse Movement)
키보드 입력(Keyboard Input)




