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.
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.
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
}
});
});