Scrollable Tools using Chaining JQuery Plugin

. 6/10/10
  • Agregar a Technorati
  • Agregar a Del.icio.us
  • Agregar a DiggIt!
  • Agregar a Yahoo!
  • Agregar a Google
  • Agregar a Meneame
  • Agregar a Furl
  • Agregar a Reddit
  • Agregar a Magnolia
  • Agregar a Blinklist
  • Agregar a Blogmarks

Scrollable Tools using Chaining JQuery Plugin

HTML

<!-- wrapper for navigator elements -->
  <div class="navi"><a href="#0" class=""></a><a href="#1" class=""></a><a href="#2" class="active"></a></div>
 
<!-- "previous page" action -->
  <a class="prev browse left"></a>
<!-- root element for scrollable -->
  <div id="chained" class="scrollable"> 
  
  <!-- root element for the items -->
  <!-- 10-15 -->
  <div class="items" style="left: -1366.53px;"><div class="cloned">
  <img src="images/pic-11.jpg" />
  <img src="images/pic-12.jpg" />
  <img src="images/pic-13.jpg" />
  <img src="images/pic-14.jpg" />
  <img src="images/pic-15.jpg" />
  </div>
  
  <!-- 1-5 -->
  <div>
  <img src="images/pic-01.jpg" />
  <img src="images/pic-02.jpg" />
  <img src="images/pic-03.jpg" />
  <img src="images/pic-04.jpg" />
  <img src="images/pic-05.jpg" />
  </div>
  
  <!-- 5-10 -->
  <div>
  <img src="images/pic-06.jpg" />
  <img src="images/pic-07.jpg" />
  <img src="images/pic-08.jpg" />
  <img src="images/pic-09.jpg" />
  <img src="images/pic-10.jpg" />
  </div>
  
  <!-- 10-15 -->
  <div>
  <img src="images/pic-11.jpg" />
  <img src="images/pic-12.jpg" />
  <img src="images/pic-13.jpg" />
  <img src="images/pic-14.jpg" />
  <img src="images/pic-15.jpg" />
  </div>
  
  <!-- 1-5 -->
  <div class="cloned">
  <img src="images/pic-01.jpg" />
  <img src="images/pic-02.jpg" />
  <img src="images/pic-03.jpg" />
  <img src="images/pic-04.jpg" />
  <img src="images/pic-05.jpg" />
  </div></div>
  
  </div>
<!-- "next page" action -->
  <a class="next browse right"></a>

CSS

.scrollable img {
 width:100px;
 margin:20px 5px 20px 21px; 
}

.scrollable img.hover {
 background-color:#123; 
}

CSS - Standalone

a:active {
  outline:none;
}

:focus {
  -moz-outline-style:none;
}

CSS - Horizontal Scrollable

.scrollable .items {
 /* this cannot be too large */
 width:20000em;
 position:absolute;
 clear:both;
 left: -1px;
 top: 3px;
}

.items div {
 float:left;
 width:680px;
}

/* single scrollable item */
.scrollable img {
 float:left;
 margin:20px 5px 20px 21px;
 background-color:#fff;
 padding:2px;
 border:1px solid #ccc;
 width:100px;
 height:75px;
 
 -moz-border-radius:4px;
 -webkit-border-radius:4px;
}

/* active item */
.scrollable .active {
 border:2px solid #000;
 position:relative;
 cursor:default;
}

CSS - Scrollable Buttons

/* this makes it possible to add next button beside scrollable */
.scrollable {
 float:left; 
}

/* prev, next, prevPage and nextPage buttons */
a.browse {
 background:url(../images/hori_large.png) no-repeat;
 display:block;
 width:30px;
 height:30px;
 float:left;
 margin:40px 10px;
 cursor:pointer;
 font-size:1px;
}

/* right */
a.right   { background-position: 0 -30px; clear:right; margin-right: 0px;}
a.right:hover  { background-position:-30px -30px; }
a.right:active  { background-position:-60px -30px; } 


/* left */
a.left   { margin-left: 0px; } 
a.left:hover   { background-position:-30px 0; }
a.left:active   { background-position:-60px 0; }

/* up and down */
a.up, a.down  { 
 background:url(../images/vert_large.png) no-repeat; 
 float: none;
 margin: 10px 50px;
}

/* up */
a.up:hover   { background-position:-30px 0; }
a.up:active   { background-position:-60px 0; }

/* down */
a.down    { background-position: 0 -30px; }
a.down:hover   { background-position:-30px -30px; }
a.down:active   { background-position:-60px -30px; } 


/* disabled navigational button */
a.disabled {
 visibility:hidden !important;  
}    

CSS - Scrollable Navigator

/* position and dimensions of the navigator */
.navi {
 margin-left:350px;
 width:200px;
 height:20px;
}


/* items inside navigator */
.navi a {
 width:8px;
 height:8px;
 float:left;
 margin:3px;
 background:url(../images/navigator.png) 0 0 no-repeat;
 display:block;
 font-size:1px;
}

/* mouseover state */
.navi a:hover {
 background-position:0 -8px;      
}

/* active state (current page state) */
.navi a.active {
 background-position:0 -16px;     
}  

JavaScript

$(document).ready(function() {
$("#chained").scrollable({circular: true, mousewheel: true}).navigator().autoscroll({
 interval: 3000  
}); 
});

jquery.tools.min.js

Click to Download

Example

Click to DEMO

0 comments: