연습장:Sakura/1: 두 판 사이의 차이

편집 요약 없음
태그: 되돌려진 기여
편집 요약 없음
태그: 되돌려진 기여
14번째 줄: 14번째 줄:
.content {
.content {
   position: absolute;
   position: absolute;
   top: 100%;
   top: 0;
   left: 0;
   left: 100%;
   width: 100%;
   width: 0;
   height: 0;
   height: 100%;
   overflow: hidden;
   overflow: hidden;
   transition: height 0.5s ease-in-out;
   transition: width 0.5s ease-in-out, left 0.5s ease-in-out;
}
}


36번째 줄: 36번째 줄:
toggleBtn.addEventListener('click', function() {
toggleBtn.addEventListener('click', function() {
   if (isCollapsed) {
   if (isCollapsed) {
     content.style.height = `${content.scrollHeight}px`;
     content.style.width = `${container.clientWidth}px`;
    content.style.left = 0;
     toggleBtn.textContent = '[접기]';
     toggleBtn.textContent = '[접기]';
   } else {
   } else {
     content.style.height = 0;
     content.style.width = 0;
    content.style.left = '100%';
     toggleBtn.textContent = '[펼치기 · 접기]';
     toggleBtn.textContent = '[펼치기 · 접기]';
   }
   }

2023년 2월 19일 (일) 18:13 판

숨겨진 내용입니다.