일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 |
- Sticky
- html
- scrollY
- width
- scrollevent
- css
- forEach
- Hover
- 이벤트리스너
- getBoundingClientRect
- addEventListener
- swiper
- swiperjs
- JavaScript
- pointermove
- mousemove
- classList
- localstorage
- NodeList
- React
- 확장성
- insertAdjacentHTML
- 스크롤
- Animation
- scroll
- 반복문
- For
- input
- NAV
- 애니메이션
- Today
- Total
목록scrollY (2)
ZeroToHunnit Coding
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bVIxee/btsEOUgc7My/G2iEY5BSzFH6mFv5p2vuT1/img.gif)
보통 홈페이지에 연혁을 보여주는 페이지를 가면 보이는 progressbar를 만들어보았다. HTML 안녕하세요요건 고정된 타이틀임다. 채워집니다~ 이것 좀 보세요오 신기하죠? 곧 끝나갑니다! CSS .section { width: 100%; position: relative; display: flex; justify-content: center; margin: 300px 0; } .title-box { position: sticky; top: 100px; left: 200px; width: 500px; height: 100%; } .progress-box { width: 5px; height: 3000px; position: relative; background-color: #999; } .progres..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/qU3fk/btsCZ20zNwU/kGaSFE5yT9WexnfLNJsEMK/img.gif)
스크롤을 내리면 전체 페이지 중 현재 어디 쯤을 읽고있는지 나타내주는 바를 만들어 보았다. HTML CSS body, html{ height: 6000px; } .bar{ width: 100vw; height: 50px; position: fixed; top: 0; left: 0; background-color: #999; } .percent{ width: 0; height: 100%; background-color: black; transition: all 0.1s; } 전체 높이 6000px로 잡아주고 bar 박스는 위에 고정시켜주었다. JAVASCRIPT let percent = document.querySelector('.percent'); let screenHeight = document.que..