-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<script src="angular.js"></script> | ||
<script src="dist/ng-scrollbar.min.js"></script> | ||
<link rel="stylesheet" href="dist/ng-scrollbar.min.css" > | ||
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 | ||
<script src="angular.js"></script> | ||
<script src="dist/ng-scrollbar.min.js"></script> | ||
<link rel="stylesheet" href="dist/ng-scrollbar.min.css" > | ||
``` | ||
|
||
## 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 | ||
<div class="scrollme" ng-scrollbar> .... </div> | ||
``` | ||
|
||
## 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 | ||
<div class="scrollme" ng-scrollbar rebuild-on="rebuild:me" > .... </div> | ||
``` | ||
|
||
```javascript | ||
// rebuild the scrollbar | ||
$scope.$broadcast('rebuild:me'); | ||
``` | ||
|
||
## Examples | ||
_(Coming soon)_ | ||
|
||
See the example in the respository. |