Files
2nd/10_Wiki/Dev/Topic_W3CSS/W3CSS_Slideshow.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

5.0 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
w3css-slideshow W3CSS Slideshow Programming_Language draft conceptual
carousel
mySlides
w3-display-container
W3.CSS 슬라이드쇼
B 0.87 2026-07-04 2026-07-04
w3css
css-framework
w3schools
slideshow
carousel
https://www.w3schools.com/w3css/w3css_slideshow.asp

W3CSS Slideshow

🎯 한 줄 통찰 (One-line insight)

The manual and automatic slideshow share IDENTICAL slide-hiding logic — the only real difference is WHAT triggers the index change: plusDivs() called by a button click (manual) versus setTimeout(carousel, 2000) recursively calling itself (automatic) — meaning a "carousel" is simply a slideshow whose advance function schedules its own next call instead of waiting for user input. [S1]

🧠 핵심 개념 (Core concepts)

  • Shared-class slides — every slide element uses the same class (mySlides), just like the Tabulators pattern; JS hides all, then shows one by index. [S1]
  • slideIndex wraparound — manual version resets to 1 if the index exceeds slide count, or to the last slide if it goes below 1, allowing infinite forward/backward cycling. [S1]
  • Automatic carouselcarousel() calls itself via setTimeout(carousel, 2000) at the end of its own execution, creating a self-perpetuating timer loop (distinct from setInterval, which the Progress Bar chapter used instead). [S1]
  • HTML slides, not just images — slides can be any HTML content (styled divs with text), not restricted to <img>. [S1]
  • Caption + indicator overlays — reuse w3-display-container/w3-display-bottomleft (from the Display chapter) for captions, and clickable w3-badge or numbered buttons as slide indicators via a currentDiv(n) function. [S1]
  • Multiple independent slideshows per page — achieved simply by giving each slideshow group a UNIQUE class name (mySlides1, mySlides2) so their JS loops don't interfere. [S1]

📖 세부 내용 (Details)

  • Manual slideshow core logic: function showDivs(n) { var i; var x = document.getElementsByClassName("mySlides"); if (n > x.length) {slideIndex = 1} if (n < 1) {slideIndex = x.length}; for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } x[slideIndex-1].style.display = "block"; }. [S1]
  • Automatic carousel (self-scheduling timer): function carousel() { ...hide all...; slideIndex++; if (slideIndex > x.length) {slideIndex = 1} x[slideIndex-1].style.display = "block"; setTimeout(carousel, 2000); }. [S1]
  • Caption overlay: <div class="w3-display-container mySlides"><img src="img_snowtops.jpg" style="width:100%"><div class="w3-display-bottomleft w3-container w3-padding-16 w3-black">French Alps</div></div>. [S1]
  • Independent multi-slideshow class separation: mySlides1 for one group, mySlides2 for another, entirely separate getElementsByClassName calls. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • setTimeout 재귀 호출 vs setInterval: 자동 슬라이드쇼는 setInterval이 아니라 carousel() 함수가 자기 자신을 setTimeout으로 다시 예약하는 재귀적 방식이라는 점이 프로그레스 바 챕터의 setInterval 방식과 대비됨. [S1]

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — 모달 챕터에서 언급된 "라이트박스(Lightbox)" 패턴이 슬라이드쇼를 모달 안에 내장하는 실전 조합 사례로 예고됨. [S1]

💻 코드 패턴 (Code patterns)

Self-scheduling automatic carousel using setTimeout recursion (JavaScript):

var slideIndex = 0;
carousel();
function carousel() {
  var i;
  var x = document.getElementsByClassName("mySlides");
  for (i = 0; i < x.length; i++) {
    x[i].style.display = "none";
  }
  slideIndex++;
  if (slideIndex > x.length) {slideIndex = 1}
  x[slideIndex-1].style.display = "block";
  setTimeout(carousel, 2000); // Change image every 2 seconds
}

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.87
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "W3.CSS Slideshow" page (Astra wiki-curation, P-Reinforce v3.1 format).