1、倒入<script src="/js/jquery.slimscroll.min.js" type="text/javascript"></script>
HTML代码:
<div class="scroller" data-height="100px" data-always-visible="1" data-rail-visible="1">
要显示的html内容。。。
</div>
JS代码:
<script>
jQuery(document).ready(function () {
$(".scroller").slimScroll({
height: 100,
alwaysVisible: false
});
$(selector).slimScroll({
'300px',
height: '500px',
size: '10px',
position: 'left',
color: '#ffcc00',
alwaysVisible: true,
distance: '20px',
start: $('#child_image_element'),
railVisible: true,
railColor: '#222',
railOpacity: 0.3,
wheelStep: 10,
allowPageScroll: false,
disableFadeOut: false
});
});
</script>