인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

pos72715448's profile image
pos72715448

asked

Apple website interaction clone!

Handling minor fixes

offsetHeight는 어디서 가져 온 값인가요?

Written on

·

294

0

            } else if (sceneInfo[i].type === 'normal') {
                sceneInfo[i].scrollHeight =  sceneInfo[i].objs.container.offsetHeight;
svgHTML/CSSjavascript인터랙티브-웹웹 디자인클론코딩

Answer 1

2

studiomeal님의 프로필 이미지
studiomeal
Instructor

offsetHeight는 html 객체가 원래 가지고 있는 속성으로, 높이값입니다.
예를들어 지금 보고 계신 이 페이지(인프런 사이트의 이 페이지)에서 개발자도구 콘솔창을 열고
document.querySelector('.is-rounded').offsetHeight
를 복사&붙여넣기 입력해보시면,
프로필이미지(게시물 왼쪽에 표시된 동그란 인프런 로고)의 높이인 32가 출력될거에요^^
즉, 우리 코드에서는 container 객체(.scroll-section)의 높이값을 가져오는 것입니다.

pos72715448's profile image
pos72715448

asked

Ask a question