iominh / ng-scrollbars

Angular wrapper of Malihu's jQuery Custom Scrollbar
http://iominh.github.io/ng-scrollbars/
MIT License
202 stars 62 forks source link

Enable/Disable scrollbar #31

Open gayanvirajith opened 8 years ago

gayanvirajith commented 8 years ago

Thanks for the nice scrollbar plugin. Is it possible enable/disable scrollbar from the controller, similar to jquery function -> http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/disable_destroy_example.html

iominh commented 8 years ago

Hi @gayanvirajith, if you're using version 0.0.10 or later then you should be able to do something like described here: https://github.com/iominh/ng-scrollbars/tree/0.0.10#updating-scrollbars

To enable/disable, you would probably call

$scope.updateScrollbar('update'); // enable
$scope.updateScrollbar('disable') // disable
C0ZEN commented 7 years ago

Maybe, add a parameter to the directive like '...Disabled' : false could be a better option (just return to avoid next steps and build) instead of build the scrollbar and then destroy it. Anyway, I'm here because I do not understand how to achieve this. Always got an error like 'this is not a function'. Any help please ? Thanks.