Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing slimscroll from div

I got a div, and to make it fancier I use the SlimScroll jQuery plugin on that div

$('#scrollable').slimscroll({
   color: '#900',
   size: '8px',
   width: '300px',
   height: '500px'
});

now there's a moment when I want this div not to have this property anymore (but to have the browser default scrollbar). How can I remove the slimscroll?

like image 994
Andrea Silvestri Avatar asked Feb 05 '12 19:02

Andrea Silvestri


2 Answers

$("#scrollable").slimScroll({destroy: true});
like image 66
ink Avatar answered Oct 15 '22 03:10

ink


I made this function which works great in my case

function destroySlimscroll(objectId) { 
   $("#"+objectId).parent().replaceWith($("#"+objectId)); 
}
like image 6
Andrea Silvestri Avatar answered Oct 15 '22 02:10

Andrea Silvestri