Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
asafdav committed Jan 17, 2014
1 parent 83168ee commit f95e848
Showing 1 changed file with 39 additions and 16 deletions.
55 changes: 39 additions & 16 deletions README.md
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.

0 comments on commit f95e848

Please sign in to comment.