Making scroll-bars more attractive.
- Include
scrull.css
( orscrull.min.css
) in your markup. - Include
scrull.js
( orscrull.min.js
) in your markup at the end of the body ( before</body>
). - Add
scrull
class to the elements you wanna to be affected by scrull.
<head>
<link rel="stylesheet" href="scrull.min.css" />
</head>
<body>
<div class="scrull section">
<!-- some content -->
</div>
<script src="scrull.min.js"></script>
</body>
above example will give a nice scroll-bar for all of your .scrull
elements by default; but if you want to use smooth-scrolling function by yourself you should check .scrullTo
method at the API section.
You've two global method to use:
scrullTo
: Smooth version for nativescrollTo
. It scrollsdocument.body
by default; But if you want to scroll inside some other element, it's possible bycall
orapply
method. Example:
scrullTo.call( someAnotherElement, 25 );
scrullIt
: The method that will fire on .scrull elements. You can easily make any element scrullable.