A jquery plugin that make a block element scrollable.
Download the production version or the development version.
In your web page:
<link rel="stylesheet" href="css/asScrollable.css">
<div class="box">
content here
</div>
<script src="jquery.js"></script>
<script src="dist/jquery-asScrollable.all.min.js"></script>
<script>
jQuery(function($) {
$('.box').asScrollable({
namespace: 'asScrollable',
contentSelector: null,
containerSelector: null,
draggingClass: 'is-dragging',
hoveringClass: 'is-hovering',
scrollingClass: 'is-scrolling',
direction: 'vertical', // vertical, horizontal, both, auto
showOnHover: true,
showOnBarHover: false,
duration: 500,
easing: 'ease-in', // linear, ease, ease-in, ease-out, ease-in-out
responsive: true,
throttle: 20,
scrollbar: {}
});
});
</script>
If we supply two wrap div for the content, the dom will not redraw which may causing issues sometimes.
<div class="box">
<div>
<div>
content here
</div>
</div>
</div>
<script>
jQuery(function($) {
$('.box').asScrollable({
namespace: 'asScrollable',
contentSelector: '>',
containerSelector: '>'
});
});
</script>