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

해시 URL 진입 시 동작 개선 #432

Open
XiNiHa opened this issue Apr 25, 2024 · 0 comments
Open

해시 URL 진입 시 동작 개선 #432

XiNiHa opened this issue Apr 25, 2024 · 0 comments
Labels
기능 개선 개선 과정에 개발자에 의한 JS 코딩이 필요한 경우

Comments

@XiNiHa
Copy link
Contributor

XiNiHa commented Apr 25, 2024

문제

  • 상단 GNB가 sticky라서 해시 URL로 진입 시 해당되는 id를 가진 요소가 GNB 뒤에 가려지게 되는 위치로 스크롤됨
  • 해시 URL로 진입하는 경우 해당 섹션을 명시적으로 가리키려 하는 경우가 대다수인데 단순히 스크롤이 내려간 상태로 페이지 이동을 하는 것만으로는 이것이 잘 드러나지 않음

해결 방안

  • 글로벌 JS를 사용해서 페이지 진입 시 URL에 해시가 있으면 해당 id를 가진 요소를 가져오고, 요소의 좌표를 가져와서 적절한 offset을 적용한 좌표를 계산한 후 smooth scroll 시켜야 함
  • 또한 해당 요소를 애니메이션 등으로 하이라이팅시켜주면 좋을듯
@XiNiHa XiNiHa added the 기능 개선 개선 과정에 개발자에 의한 JS 코딩이 필요한 경우 label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
기능 개선 개선 과정에 개발자에 의한 JS 코딩이 필요한 경우
Projects
None yet
Development

No branches or pull requests

1 participant