diff --git a/README.md b/README.md index 3457c49..d1a12ed 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,48 @@ # ng-scrollbar -A custom scrollbar written in pure AngularJS +A custom scrollbar written in pure AngularJS. +Tired of using jquery for a stupid scrollbar? well, this directive is just for you. -## Getting Started -Download the [production version][min] or the [development version][max]. +## Usage -[min]: https://raw.github.com/asafdav/ng-scrollbar/master/dist/angular-ng-scrollbar.min.js -[max]: https://raw.github.com/asafdav/ng-scrollbar/master/dist/angular-ng-scrollbar.js +1. Add ng-scrollbar.min.js to you main file (index.html) -In your web page: - -```html - - - + you can download this by: + * using bower and running `bower install ng-scrollbar` + * Download the [production version][min] or the [development version][max]. + + [min]: https://raw.github.com/asafdav/ng-scrollbar/master/dist/angular-ng-scrollbar.min.js + [max]: https://raw.github.com/asafdav/ng-scrollbar/master/dist/angular-ng-scrollbar.js + + In your web page: + + ```html + + + ``` -## Documentation -_(Coming soon)_ - +2. Set `ngScrollbar` as a dependency in your module + ```javascript + var myapp = angular.module('myapp', ['ngScrollbar']) + ``` + +3. Add ng-scrollbar directive to the wanted element, example: + ```html +
....
+ ``` + +## Rebuild the scrollbar +In case you need to rebuild the scorllbar, you may tell ng-scrollbar to rebuild it for you by broadcasting an event. + ```html +
....
+ ``` + + ```javascript + // rebuild the scrollbar + $scope.$broadcast('rebuild:me'); + ``` + ## Examples -_(Coming soon)_ - +See the example in the respository.