Files
2nd/10_Wiki/Topic_Programming/Topic_W3CSS/W3CSS_Slideshow.md
T
Antigravity Agent e9cbf23ab5 docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
2026-07-05 00:39:13 +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).