Scrollable image slider is one of the interesting features in the image gallery application. This allows us to display thumbnails in the form of slides that can be scrolled automatically or manually using the control buttons.
Figure below shows a scrollable image slider featuring four thumbnails per slide. To display thumbnails from another slide, simply by clicking the navigation buttons located on the right and left slide. Slides can also be scrolled automatically by using the left and right arrow keyboard or using the mouse wheel.

In this tutorial, i’ll use Scrollable component from jQuery Tools user interface (UI) library which is based on popular jQuery javascript framework. Current version of jQuery Tools at the time of this writing is version 1.1.2, which can be downloaded here. The library itself consists of six user interface components that can be easily combined: Tabs, Tooltip, Overlay, Scrollable, Expose, and Flashembed.
How to Setup
- Download Scrollable component from download page and save it as jquery.tools.min.js. You can download it with jQuery (v1.3.2) as a single file (21.75 kb) or as a separated file (3.37 kb) if you already have jQuery.
- Include the jquery.tools.min.js in the HEAD section of your HTML file
<script src="scripts/jquery.tools.min.js" type="text/javascript"></script>
or
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="scripts/jquery.tools.min.js" type="text/javascript"></script>
Using Scrollable UI library
HTML Code
<a class="prevPage left"></a> <div class="scrollable"> <div class="items"> <!-- 1-4 --> <img src="http://londatiga.net/tutorials/scrollable/images/img1.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img2.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img3.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img4.jpg" /> <!-- 5-8 --> <img src="http://londatiga.net/tutorials/scrollable/images/img5.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img6.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img7.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img8.jpg" /> <!-- 10-12 --> <img src="http://londatiga.net/tutorials/scrollable/images/img9.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img10.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img11.jpg" /> <img src="http://londatiga.net/tutorials/scrollable/images/img12.jpg" /> </div> </div> <a class="nextPage right"></a>
line 01: element for left/prev button.
line 02: root element (div) for the scrollable.
line 03: wrapper element.
line 04-20: scrollable images (will be displayed four images per slide).
line 24: element for right/next button.
CSS Code
Scrollable
.scrollable { background: #ccc; position: relative; overflow: hidden; width: 690px; height:145px; border:1px solid #ccc; -moz-border-radius:4px; -webkit-border-radius:4px; } .scrollable .items { width: 20000em; position: absolute; clear: both; } .scrollable img { opacity: 0.6; float:left; margin:15px 5px 15px 15px; background-color:#fff; cursor:pointer; width:150px; height:113px; -moz-border-radius:4px; -webkit-border-radius:4px; } .scrollable .active { opacity:1; border:2px solid #000; z-index:9999; position:relative; }
line 01, style for container element, the length and width depends on image size and how many images you want displayed per slide.
line 12, style for wrapper element.
line 18, style for images in a slide.
line 30, style for selected image.
Navigation button (prev & next)
.scrollable { float:left; } a.left, a.right { display: block; width: 18px; height: 18px; float: left; margin: 60px 10px; cursor: pointer; } a.right { background: url(scrollable/arrow/right.png) no-repeat; clear:right; margin-right: 0px;} a.right:hover { background-position:0px -18px; } a.right:active { background-position:0px 0px; } a.left { background: url(scrollable/arrow/left.png) no-repeat; margin-left: 0px; } a.left:hover { background-position:0px -18px; } a.left:active { background-position:-0px 0px; } a.disabled { visibility:hidden !important; }
line 01, allow next and prev buttons placed on each side of the slide.
line 12, set size and position of prev and next buttons.
line 16, set background image for prev and next buttons.
Javascript Code
<script> $(function() { $("div.scrollable").scrollable({size: 4}); }); </script>
$(“div.scrollable”) is a jQuery selector for scrollabe container. On example above, we set four images for each slide using configuration parameter ‘size‘. Default value of ‘size‘ parameter is 5. You can learn more about the API of the Scrollable component on this page.







very cool & good tip, thank you very much for sharing.
Can I share this post on my JavaScript library?
Awaiting your response. Thank
yes, please..
I very enjoy this fantastic post which are provided for us. I confirm this would be advantageous for most of the people.
I am looking for a scrollable gallery like this (Non-Flash) that shows all thumbnail images black and white – then when you roll over a thumbnail image it becomes full color AND populates in a full size larger cell above the gallery scroll bar, is this possible? If so, how would this be accomplished?
Please advise?
I’ve been looking for something like this! Thanks for sharing this great tool!
it makes you wonder where people get the idea that short-term planning will yield immediate rewards.
Thank you so much for this tutorial! This will surly! I can now finish my website off for a college assignment!
Thank you so much for this tutorial! This will surly help me finish my website off for a college assignment!*
God knows what I typed before…
How would you modify this to display information text when each picture is clicked on a different portion on your website?
Hello! eegdagf interesting eegdagf site! I’m really like it! Very, very eegdagf good!
Hello!
, , , ,
Hi I am new to JQuery what do I need to download before incorporating the code ?
Also the links in set up section don’t work