slimscroll滚动条插件简单用法

     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({
             width: '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>

posted @ 2015-05-28 10:38  秋月光璇LMQ  阅读(2843)  评论(0编辑  收藏  举报