Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- modal
- mysql if
- angular button
- formgroup
- Ionic modal
- Router
- 스크롤 이벤트
- angular animation
- 셀렉트박스 커스텀
- angular modal
- summary
- TAILWIND
- 앵귤러 모달
- 앵귤러 애니메이션
- scroll
- 호버
- 스크롤 이벤트 감지
- 모달
- 아이오닉 스크롤 이벤트
- ajax 사용 예시
- flex-1
- 옵저버블
- egov spring ajax 사용 예시
- angular route
- ApexChart
- route
- 검색
- Oracle LISTAGG 사용 예시
- prisma
- Angular Router
Archives
- Today
- Total
깜놀하는 해므찌로
scrollbar sidemenu stop 사이드 메뉴 멈추게 하기 예시 / scroll side 본문
반응형
SMALL
<section (scroll)=onScroll();
#section>
<div #reportDiv >
<app-report-menu
[ngClass]="{'fixed' : reportMenuPosition < 5600, 'absolute bottom-[5rem]' : reportMenuPosition >= 5600}"
>
</app-report-menu>
</div>
</section>
1. 부모요소의 크기에 맞게만 사이드를 내려오도록 설정하기
2. ngClass 를 활용하여 fixed, absolute 로 조절
@ViewChild('headerDiv', { read: ElementRef }) headerDiv: ElementRef;
reportMenuPosition = 0;
onScroll() {
this.scrollTop = this.section.nativeElement.scrollTop;
this.reportMenuPosition =
this.scrollTop + this.reportDiv.nativeElement.clientHeight;
}
3. bottom 을 기준으로 멈춰야 하므로 스크롤 탑 + div 요소를 더해서 bottom 을 구하기
4. 전역 변수에 할당 후 해당 변수를 템플릿에 활용하여 적용
반응형
LIST
'IT' 카테고리의 다른 글
Docker run options / 도커 실행 명령어 및 자주 사용되는 옵션 (0) | 2023.09.06 |
---|---|
Video Tag 비디오 태그 활용 예시 (0) | 2023.09.05 |
Scroll 스크롤 감지 예시 (0) | 2023.09.03 |
Angular resize Service 예시 / response width (0) | 2023.09.02 |
Angular ScrollService 구현 예시 / scroll (0) | 2023.09.01 |