Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ specify this to change the parent container. (default: `body`)
NProgress.configure({ parent: '#container' });
~~~

#### `topPosition`
Configure this to change the top position of the bar. (default: `0`)

~~~ js
NProgress.configure({ topPosition: 20 });
~~~

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

Expand Down
6 changes: 5 additions & 1 deletion nprogress.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
barSelector: '[role="bar"]',
spinnerSelector: '[role="spinner"]',
parent: 'body',
template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>',
topPosition: '0'
};

/**
Expand Down Expand Up @@ -79,6 +80,9 @@

// Add transition
css(bar, barPositionCSS(n, speed, ease));

// Set position from top
css(bar, { top: Settings.topPosition });

if (n === 1) {
// Fade out
Expand Down