Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery nicescroll

I'm using nicescroll plugin. http://areaaperta.com/nicescroll/

I have just a little doubt. When the page is loaded I can see my default scroll bar from the browser, and then the nicescroll bar it is showed. I want to apply the nicescroll bar to all the document and I have the following code

var nice = $("body").niceScroll({
        preservenativescrolling: false,
        cursorwidth: '8px',
        cursorborder: 'none',
        cursorborderradius:'0px',
        cursorcolor:"#39CCDB",
        autohidemode: false, 
        background:"#999999"
     });

If I set the autohidemode to true, I don't see the default scroll bar from the browser. But I want to make the nicescroll bar always visible.

Does anyone know why this is happening?? Thanks

like image 314
saomi Avatar asked Sep 17 '12 22:09

saomi


2 Answers

Maybe this might help you. It works for me.

<script id="twitter-wjs" src="../js/widgets.js"></script>
<script src="../js/jquery.min.js"></script>
<script src="../js/jquery.easing.1.3.js"></script>
<script src="../js/jquery.nicescroll.min.js"></script>


<script>

  // Hide Overflow of Body on DOM Ready //
$(document).ready(function(){
    $("body").css("overflow", "hidden");
});

// Show Overflow of Body when Everything has Loaded //
$(window).load(function(){
    $("body").css("overflow", "visible");        
    var nice=$('html').niceScroll({cursorborder:"",cursorcolor:"#333333",cursorwidth:"8px", boxzoom:true, autohidemode:false});

});
</script>
like image 123
user1979388 Avatar answered Nov 19 '22 00:11

user1979388


here is an example of what you might want:

if (jQuery().niceScroll) {
    $("html").niceScroll({
        scrollspeed: 70,
        mousescrollstep: 38,
        cursorwidth: 15,
        cursorborder: 0,
        cursorcolor: '#0C090A',
        cursorborderradius: 0,
        autohidemode: true,
        horizrailenabled: false
    });
}
like image 40
MinCarve Avatar answered Nov 19 '22 00:11

MinCarve