You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're using AMD or Browserify, you can pass your options to `start`:
@@ -67,7 +67,7 @@ Themes
67
67
------
68
68
69
69
Pace includes a bunch of [themes](https://codebyzach.github.io/pace/)
70
-
to get you started. Just include the appropriate css file. Send us a PR with
70
+
to get you started. Just include the appropriate css file. Send us a PR with
71
71
any interesting themes you create.
72
72
73
73
If you have minor styling changes and don't want to extend theme css, you can add custom class names to
@@ -82,7 +82,7 @@ paceOptions = {
82
82
Collectors
83
83
----------
84
84
85
-
Collectors are the bits of code which gather progress information. Pace includes four default collectors:
85
+
Collectors are the bits of code which gather progress information. Pace includes four default collectors:
86
86
87
87
- Ajax
88
88
@@ -113,17 +113,17 @@ paceOptions = {
113
113
};
114
114
```
115
115
116
-
Add your own classes to `paceOptions.extraSources` to add more sources. Each source should either
116
+
Add your own classes to `paceOptions.extraSources` to add more sources. Each source should either
117
117
have a `.progress` property, or a `.elements` property which is a list of objects with
118
-
`.progress` properties. Pace will automatically handle all scaling to make the progress
118
+
`.progress` properties. Pace will automatically handle all scaling to make the progress
119
119
changes look smooth to the user.
120
120
121
121
Elements
122
122
--------
123
123
124
124
Elements being rendered to the screen is one way for us to decide that the page has been
125
-
rendered. If you would like to use that source of information (not required at all),
126
-
specify one or more selectors. You can comma separate the selectors to propertly handle
125
+
rendered. If you would like to use that source of information (not required at all),
126
+
specify one or more selectors. You can comma separate the selectors to propertly handle
127
127
error states, where the progress bar should disappear, but the element we are looking for
128
128
may never appear:
129
129
@@ -135,23 +135,23 @@ paceOptions = {
135
135
}
136
136
```
137
137
138
-
Pace will consider the elements test successful when each selector matches something. For
138
+
Pace will consider the elements test successful when each selector matches something. For
139
139
this example, when either `.timeline` or `.timeline-error` exist, and either `.user-profile`
140
140
or `.profile-error` exist.
141
141
142
142
Restart Rules
143
143
-------------
144
144
145
145
Most users want the progress bar to automatically restart when a pushState event occurs
146
-
(generally means ajax navigation is occuring). You can disable this:
146
+
(generally means ajax navigation is occuring). You can disable this:
147
147
148
148
```javascript
149
149
paceOptions = {
150
150
restartOnPushState:false
151
151
}
152
152
```
153
153
154
-
You can also have pace restart on every ajax request which lasts longer than x ms. You'll want to
154
+
You can also have pace restart on every ajax request which lasts longer than x ms. You'll want to
155
155
disable this if you make ajax requests the user doesn't need to know about, like precaching:
156
156
157
157
```javascript
@@ -162,16 +162,16 @@ paceOptions = {
162
162
163
163
You can always trigger a restart manually by calling `Pace.restart()`
164
164
165
-
See [the source](https://github.com/CodeByZach/pace/blob/master/pace.js) for a full list of all options.
165
+
See [the source](https://github.com/CodeByZach/pace/blob/master/pace.js) for a full list of options.
166
166
167
167
API
168
168
---
169
169
170
170
Pace exposes the following methods:
171
171
172
-
-`Pace.start`: Show the progress bar and start updating. Called automatically if you don't use AMD or CommonJS.
172
+
-`Pace.start`: Show the progress bar and start updating. Called automatically if you don't use AMD or CommonJS.
173
173
174
-
-`Pace.restart`: Show the progress bar if it's hidden and start reporting the progress from scratch. Called automatically
174
+
-`Pace.restart`: Show the progress bar if it's hidden and start reporting the progress from scratch. Called automatically
175
175
whenever `pushState` or `replaceState` is called by default.
176
176
177
177
-`Pace.stop`: Hide the progress bar and stop updating it.
@@ -254,24 +254,25 @@ Support
254
254
-------
255
255
256
256
Pace is designed to support IE8+ (standards mode), FF 3.5+, Chrome, Safari 4+, Opera 10.5+, and all modern
257
-
mobile browsers. If you run into a compatibility issue, or can make a case for supporting something else,
257
+
mobile browsers. If you run into a compatibility issue, or can make a case for supporting something else,
258
258
please create an issue.
259
259
260
260
Size
261
261
----
262
262
263
-
pace.js is 4kb minified and gzipped. The themes vary between 0.5 and 4kb.
263
+
pace.js is 4kb minified and gzipped. The themes vary between 0.5 and 4kb.
264
264
265
265
Issues
266
266
------
267
267
268
-
We have obviously not tested this on every website. If you run into an issue, or find a way the automatic
269
-
detection could be better, please [create an Issue](https://github.com/CodeByZach/pace/issues/new). If you can include a test case, that's even better.
268
+
We have obviously not tested this on every website. If you run into an issue, or find a way the automatic
269
+
detection could be better, please [create an Issue](https://github.com/CodeByZach/pace/issues/new). If you can include a test case, that's even better.
270
270
271
271
Credits
272
272
-------
273
273
274
274
[HubSpot](http://dev.hubspot.com)
275
+
[CodeByZach](https://github.com/CodeByZach)
275
276
276
277
Javascript by [Zack Bloom](http://twitter.com/zackbloom)
277
278
CSS by [Adam Schwartz](http://twitter.com/adamfschwartz)
0 commit comments