[Angular] fragment(/#) 스크롤 포커스 이동하게 하기

2020. 6. 26. 11:49·개발일지/2020
반응형

단순하게 <div id="target"></div> 원하는 곳에 아이디를 만들고, 링크에 <a href="#target">타겟 이동</a> 하면 되는데 앵귤러에서는 제대로 작동하지 않아서 찾아보니 아래와 같은 방법이 있었다.

 

https://stackoverflow.com/questions/46658522/how-to-smooth-scroll-to-page-anchor-in-angular-4-without-plugins-properly

 

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

 

반응형
저작자표시 비영리 변경금지 (새창열림)

'개발일지 > 2020' 카테고리의 다른 글

[ie11] 인터넷 익스플로러에서 grid 사용하기  (0) 2020.07.09
[ie11] flex시 margin: auto; 적용되지 않는 이유  (2) 2020.07.09
[CSS] 이미지 스프라이트(image sprite) 레티나 대응하기  (0) 2020.06.24
[HTML] iframe은 가고 portals이 온다  (0) 2020.06.16
[DM] HTML Email Template Markup (이메일 마크업)  (0) 2020.05.28
'개발일지/2020' 카테고리의 다른 글
  • [ie11] 인터넷 익스플로러에서 grid 사용하기
  • [ie11] flex시 margin: auto; 적용되지 않는 이유
  • [CSS] 이미지 스프라이트(image sprite) 레티나 대응하기
  • [HTML] iframe은 가고 portals이 온다
zineeworld
zineeworld
2013년부터 마크업 개발을 하고 있습니다.
  • zineeworld
    zineeworld
    zineeworld
    • 전체보기 (447)
      • 지니월드 (150)
        • 회고 (8)
        • 경력 (33)
        • 경험 (39)
        • 공부 (22)
        • 수집 (27)
        • 단상 (16)
        • 장소 (5)
      • 개발일지 (297)
        • 2025 (3)
        • 2024 (9)
        • 2023 (10)
        • 2022 (1)
        • 2021 (11)
        • 2020 (29)
        • 2019 (10)
        • 2018 (21)
        • 2017 (10)
        • 2016 (91)
        • 2015 (95)
        • 2014 (7)
  • 블로그 메뉴

    • 글쓰기
    • 관리자
  • 전체
    오늘
    어제
  • 태그

    회돈내산
    css-drawing
    회고
    디자인시스템
    CSS
    git
    htmlemail
    오늘의영감
    css-drawing-tutorial
    회사일기
    react
    SVG
    널리
    리더의착각
    Mobile
    팀장일기
    웹접근성
    zineepick
    깃
    angular
  • hELLO· Designed By정상우.v4.10.2
zineeworld
[Angular] fragment(/#) 스크롤 포커스 이동하게 하기
상단으로

티스토리툴바