강의

멘토링

커뮤니티

Inflearn Community Q&A

yohank's profile image
yohank

asked

Getting Started with Interactive Web Development

Manipulating objects based on scroll position

소스 코드 맨 하단에 showValue();를 한번 더 써주신 이유가 있을까요?

Written on

·

358

0

window.addEventListener에서 scroll 동작 할때 showValue()를 호출해주는데 

아래에서 또 showValue()를 호출하는 이유가 있는지 궁금해서요~

아 그리고 num 변수는 만들어두신 이유가 있을까요~?

인터랙티브-웹HTML/CSSjavascript

Answer 2

1

studiomeal님의 프로필 이미지
studiomeal
Instructor

문서를 처음 로드했을 때, 즉 스크롤이 발생하기 전에도 한번 실행해준다- 이런 의도로 생각하시면 됩니다~

0

yohank님의 프로필 이미지
yohank
Questioner

감사합니다~!

yohank's profile image
yohank

asked

Ask a question