Scrollable Tools using 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 Jquery Plugin

HTML


<!-- "previous page" action -->
  <a class="prev browse left"></a>
<!-- root element for scrollable -->
  <div class="scrollable"> 
  
  <!-- root element for the items -->
  <div class="items">
  
  <!-- 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>

  </div>
  
  </div>
<!-- "next page" action -->
  <a class="next browse right"></a>





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;  
}    



JavaScript


$(function() {
 $(".scrollable").scrollable();
});



jquery.tools.min.js


Click to Download


Example


Click to DEMO

0 comments: