Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24 - Sticky Nav #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

changicho
Copy link
Member

?: javscript로 스크롤 위치 판단, CSS로 디자인
javascript로 nav가 sticky 해야 하는지 판단

  • offsetTop (위에서 떨어진 위치)
  • offsetHeight (자체 높이)
  • window.scrollY (스크롤을 얼마나 했는지)

CSS의 class 지정으로 디자인 변경
전부 javascript로 하는 것보다 때에 따라 classList에 추가, 삭제
하는 편이 더 간단함

?: javscript로 스크롤 위치 판단, CSS로 디자인
javascript로 nav가 sticky 해야 하는지 판단
- offsetTop (위에서 떨어진 위치)
- offsetHeight (자체 높이)
- window.scrollY (스크롤을 얼마나 했는지)

CSS의 class 지정으로 디자인 변경
전부 javascript로 하는 것보다 때에 따라 classList에 추가, 삭제
하는 편이 더 간단함
@changicho changicho changed the title Feat: Add 24 - Sticky Nav 24 - Sticky Nav Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant