How to create a button with the Custom Scrollbar plugin? [closed]

-1

Custom Scrollbar

My idea is to create just one button. When you click it it is enabled and automatic scrolling works, clicking again turns it off and disables automatic scrolling.

    
asked by anonymous 11.02.2014 / 18:35

1 answer

1

Create custom scroll for a div:

$ (".content"). mCustomScrollbar ({     scrollInertia: 150 });

Remove the custom scroll from a div:

$('#remove-scroll').click(function(e){
    e.preventDefault();
    $(".content").mCustomScrollbar("destroy");
});

Add custom scroll

$("#adiciona-scroll").click(function(e){
    e.preventDefault();
    $(".content").mCustomScrollbar("update");
});

Re-create custom scroll

$("#recria-scroll").click(function(e){
    e.preventDefault();
    $(".content").mCustomScrollbar({
        scrollButtons:{
            enable:true
        }
    });
});
    
11.02.2014 / 18:42