반응형
단순하게 <div id="target"></div> 원하는 곳에 아이디를 만들고, 링크에 <a href="#target">타겟 이동</a> 하면 되는데 앵귤러에서는 제대로 작동하지 않아서 찾아보니 아래와 같은 방법이 있었다.
How to smooth scroll to page anchor in angular 4 without plugins properly?
What I want to achieve is a click to and do a smooth scroll to bottom / specified div area which i define with hashtag just like i think it should be like this. here is the live example in the
stackoverflow.com
https://developer.mozilla.org/ko/docs/Web/API/Element/scrollIntoView
element.scrollIntoView
다른 요소의 레이아웃에 따라 위쪽 또는 아래쪽으로 완전히 스크롤되지 않을 수 있습니다.
developer.mozilla.org
반응형
'DEV > JS' 카테고리의 다른 글
[JS] gulp.spritesmith 레티나 이미지 스프라이트 자동화 (기본편) (0) | 2020.07.13 |
---|---|
[JS] package-lock.json (0) | 2020.07.13 |
[JS] User Agent 브라우저 정보 얻기 (크롬인지 아닌지 체크하기) (2) | 2019.01.07 |
[JS] 초보자를 위한 바닐라 자바스크립트 (노마드 코더스) (2) | 2018.12.08 |
[JS] JavaScript Drum Kit을 응용한 Zinee Piano (0) | 2018.04.26 |