ScrollBar

Responsive jQuery Scrollbar Plugin

A fancy custom scroll bar jquery plugin use it to replace the boring default scroll options provided by the browser. Plugin works every where including PC, iPad, iPhone and Android.

ScrollBar - Responsive jQuery Scrollbar Plugin

Features

  1. Works on PC, iPad, iPhone, Android Phones
  2. Extendable (Lots of options available)
  3. Customizable via CSS
  4. Arrow key input enabled
  5. Mousewheel input enabled
  6. Touch and Swipe enabled

Examples

Change Theme :

Scrollbar Plugin

Lorem ipsum dolor sit amet. Aliquam erat volutpat. Maecenas non tortor nulla, non malesuada velit.

Aliquam erat volutpat. Maecenas non tortor nulla, non malesuada velit. Nullam felis tellus, tristique nec egestas in, luctus sed diam. Suspendisse potenti.

Consectetur adipiscing elit. Nulla consectetur libero consectetur quam consequat nec tincidunt massa feugiat. Donec egestas mi turpis. Fusce adipiscing dui eu metus gravida vel facilisis ligula iaculis. Cras a rhoncus massa. Donec sed purus eget nunc placerat consequat.

Cras venenatis condimentum nibh a mollis. Duis id sapien nibh. Vivamus porttitor, felis quis blandit tincidunt, erat magna scelerisque urna, a faucibus erat nisl eget nisl. Aliquam consequat turpis id velit egestas a posuere orci semper. Mauris suscipit erat quis urna adipiscing ultricies. In hac habitasse platea dictumst. Nulla scelerisque lorem quis dui sagittis egestas.

Etiam sed massa felis, aliquam pellentesque est.

Nam eu arcu at purus tincidunt pharetra ultrices at ipsum. Mauris urna nunc, vulputate quis gravida in, pharetra id mauris. Ut sit amet mi dictum nulla lobortis adipiscing quis a nulla. Etiam diam ante, imperdiet vel scelerisque eget, venenatis non eros. Praesent ipsum sem, eleifend ut gravida eget, tristique id orci. Nam adipiscing, sem in mattis vulputate, risus libero adipiscing risus, eu molestie mi justo eget nulla.

Cras venenatis metus et urna egestas non laoreet orci rutrum. Pellentesque ullamcorper dictum nisl a tincidunt. Quisque et lacus quam, sed hendrerit mi. Mauris pretium, sapien et malesuada pulvinar, lorem leo viverra leo, et egestas mi nisl quis odio.

Aliquam erat volutpat. Sed urna arcu, tempus eu vulputate adipiscing, consectetur et orci. Vivamus congue, nunc vitae fringilla convallis, libero massa lacinia lorem, id convallis mauris elit ut leo. Nulla vel odio sem. Duis lorem urna, congue vitae rutrum sed, tincidunt vel tortor. In hac habitasse platea dictumst. Nunc vitae enim ante, vitae facilisis massa. Etiam sagittis sapien at nibh fermentum consectetur convallis lacus blandit.

the end.

How To Use

This script goes into head section

<!-- Include jQuery Library -->
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js" type="text/javascript"> </script>
<link href="Scrollbar.css" rel="Stylesheet" />
<link href="Scrollbar-theme1.css" rel="Stylesheet" />
<script src="Scrollbar.js" type="text/javascript"></script>
<script src="swipe.js" type="text/javascript"></script>
<script src="dragable.js" type="text/javascript"> </script>
<script type="text/javascript">
    $(window).load(function () {
            $(".rst-scroll").scrollbar({ ShowAlways: true });
        });
</script>
            

HTML Example

<div class="rst-scroll" style="height: 300px; overflow: hidden;">Put all content here.</div>

<div class="rst-scroll" style="height: 300px; overflow:hidden"><img src="picture.jpg" /></div>
Instructions

All scrollbar enabled elements should have max-height set. Scrollbars will only appear if content is hidden.

Usage Options

These options shall be used when you initialize scrollbar plugin on an element. Plugin also provides scrollit(args) function as well.

Option Default Description
Scroll 'both' 'both' | 'vertical' | 'horizontal'
ShowAlways false true | false

If set to true, scrollbar will be visible be default else they will be visible on mouseover.

OnInit null
function() { }

Callback function called when each scrollbar is initialized.

OnInitComplete null
function() { }

Callback function called when initialization of each scrollbar is complete.

OnScroll null
function(direction) { }

Callback function called when scroll happens. Direction will have either of these values - d | u | l | r

Usage options of scrollit function. This function will not trigger onscroll callback.

$('selector').scrollbar('scrollit', {direction : 'u', distance : 20});
Option Default Description
direction 'u' 'u' | 'd' | 'l' | 'r'
distance 0 integer

Usage options of update function. Call this function when you want to update content of the element.

$('selector').scrollbar('update', {html : ''});

Download Scrollbar Files

  1. scrollbar.js
  2. scrollbar.css
  3. scrollbar-theme1.css
  4. scrollbar-theme1.css