Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 모듈
- 문자열
- array
- json
- video
- 배열
- event
- ES6
- 이벤트 루프
- Promise
- Push
- 이벤트 위임
- IntersectionObserver
- async
- ios
- 스크롤
- 비동기
- ajax
- animation
- 고차함수
- dom
- 클로저
- This
- 이벤트
- scroll
- slice
- Flex
- 애니메이션
- object
- input
Archives
- Today
- Total
목록이동 (1)
FEDev Story
페이지내 hash 이동하기
브라우저 주소창에 hash값을 id로 페이지내에서 이동해야 할 경우가 있다. http://www.test.co.kr/list/list.html#d_20200330 window.location.hash로 hash값을 얻을 수 있다. var hash = window.location.hash;//#d_20200330 아래는 window.location.hash로 얻은 hash값을 moveToHash()함수에 전달하여 호출함으로써 페이지내에서 해당 hash값을 id로 하는 div로 이동하는 코드이다. var hash = window.location.hash; function moveToHash(hash){ if(hash.length > 0){ var selector = document.querySelector(..
Web.Dev
2020. 3. 25. 17:20