Skip to content

Commit

Permalink
Readme: update with parent usage notes. (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Jun 21, 2014
1 parent 098ea93 commit 613a42c
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,47 +84,56 @@ __Get the status value:__ To get the status value, use `.status`
Configuration
-------------

Change the minimum percentage using `minimum`.
**minimum**: Changes the minimum percentage. (default: `0.08`)

~~~ js
NProgress.configure({ minimum: 0.1 });
~~~

You can change the markup using `template`. To keep the progress
bar working, keep an element with `role='bar'` in there.
**template**: You can change the markup using `template`. To keep the progress
bar working, keep an element with `role='bar'` in there. See the [default template]
for reference.

~~~ js
NProgress.configure({
template: "<div class='....'>...</div>"
});
~~~

Adjust animation settings using `ease` (a CSS easing string) and `speed` (in
ms).
**ease** and **speed**:
Adjust animation settings using `ease` (a CSS easing string) and `speed`
(in ms).

~~~ js
NProgress.configure({ ease: 'ease', speed: 500 });
~~~

Want to turn off trickling? Set `trickle` to `false`.
**trickle**: Want to turn off trickling? Set `trickle` to `false`. (default: `true`)

~~~ js
NProgress.configure({ trickle: false });
~~~

**trickleRate** and **trickleSpeed**:
You can adjust the `trickleRate` (how much to increase per trickle) and
`trickleSpeed` (how often to trickle, in ms).

~~~ js
NProgress.configure({ trickleRate: 0.02, trickleSpeed: 800 });
~~~

Want to turn off loading spinner? Set `showSpinner` to `false`.
**showSpinner**: Turn off loading spinner by setting it to false. (default: `true`)

~~~ js
NProgress.configure({ showSpinner: false });
~~~

**parent**: specify this to change the parent container. (default: `body`)

~~~ js
NProgress.configure({ parent: '#container' });
~~~

Customization
-------------

Expand Down Expand Up @@ -152,6 +161,8 @@ its [contributors][c]
* [Github](http://github.com/rstacruz) (@rstacruz)
* [Twitter](http://twitter.com/rstacruz) (@rstacruz)

[default template]: https://github.com/rstacruz/nprogress/blob/master/nprogress.js#L31

[rsc]: http://ricostacruz.com
[c]: http://github.com/rstacruz/nprogress/contributors
[Turbolinks]: https://github.com/rails/turbolinks
Expand Down

0 comments on commit 613a42c

Please sign in to comment.