티스토리 뷰

Glider 는 고정된 공간 내에서 아코디언과 같이 내용을 바꿔서 보여줍니다.

유명한 곳은 CODA Glider 입니다. 제작자의 사이트에서도 사용했었다는군요. (아래 그림)


* 준비물: prototype.js & scriptacoulous.js & Glider.js


다운받기 싫다면 Google Ajax Libraries 에서 로딩
 
또는
   
로딩 순서는 틀리면 안됨

Glider 는 3개의 CSS Class 를 사용한다.
  • scroller – serves as a window in which sections will appear, one at a time
  • section – wraps around contents in individual panels in the glider
  • controls – wraps around the tabs to allow navigation to any panel in the glider

제작자가 만들었던 기초적 레이아웃은 아래와 같다

예제 HTML
 
예제 CSS
.side-nav { float: left; width: 20px; height: 200px; } 
.side-nav a { display: block; text-indent: -9999px; width: 20px; height: 200px; } 
#nav-previous a { background: url(images/previous-arrow.png) no-repeat center center; } 
#nav-next a { background: url(images/next-arrow.png) no-repeat center center; } 

.scroller { float: left; overflow: hidden; width: 500px; height: 200px; } 
.controls { clear: both; overflow: hidden; width: 540px; height: 30px; } 
.controls ul { list-style: none; margin: 0 auto; padding: 0; width: 500px; } 

.clearfix:after { clear: both; content: "."; display: block; height: 0; visibility: hidden; }

데모 보기

[출처] http://www.teddy-o-ted.com/tutorials/compacting-contents-using-glider-script/
댓글