Skip to content

Commit

Permalink
Merge pull request #6 from haensl/bug/updateReadmeForSelectors
Browse files Browse the repository at this point in the history
Update readme for selectors
  • Loading branch information
haensl committed Apr 13, 2016
2 parents 8b712fc + c014a2b commit 460984b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.4.1
-----

- Update readme for selectors

1.4.0
-----

Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

* Exposes a service that scrolls an arbitrary element to another element's location.
* Promise enabled: The service returns a promise and resolves upon completion of the scroll operation.
* Selector enabled: Use CSS selectors to specify to which element to scroll.
* Clean: No classes, no jQuery, no CSS, just plain Angular.js

## Installation
Expand Down Expand Up @@ -52,6 +53,14 @@ Inject the `animatedScroll` service into your directive, factory, controller, et
}]);
```
### Example: Using CSS selectors
```javascript
angular.module('myController', ['animatedScroll', function(animatedScroll) {
animatedScroll.scroll('#someElement');
}]);
```
### Example: Leveraging the promise
```javascript
Expand Down Expand Up @@ -83,9 +92,9 @@ angular.module('myController', ['animatedScroll', function(animatedScroll) {
## Arguments
### element *(required)*
Type: `Element | angular.element`
Type: `Element | angular.element | selector (string)`
The element to scroll to.
The element to scroll to. This can be an angular.element, (HTML)Element or CSS selector string.
### options *(optional)*
Type: `Object`
Expand Down Expand Up @@ -133,10 +142,10 @@ Default: `16`
The time for one animation frame in milliseconds.

### scrollElement
Type: `Element | angular.element`
Type: `Element | angular.element | selector (string)`
Default: `window`

The element to scroll.
The element to scroll. This can be an angular.element, (HTML)Element or CSS selector string.

## [Changelog](CHANGELOG.md)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-animated-scroll",
"version": "1.4.0",
"version": "1.4.1",
"description": "A promise based angular.js service to facilitate animated scrolling.",
"main": "dist/ngAnimatedScroll.service.min.js",
"scripts": {
Expand Down

0 comments on commit 460984b

Please sign in to comment.