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
Copy file name to clipboardExpand all lines: explainer.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This repo outlines an API that can be used to understand movement of DOM element
6
6
7
7
## Observing Position
8
8
9
-
The web's traditional position calculation mechanisms rely on explicit queries of DOM state. Some of these are known to cause style recalcuation and layout and, frequently, are redundant thanks to the requirement that scripts poll for this information.
9
+
The web's traditional position calculation mechanisms rely on explicit queries of DOM state. Some of these are known to cause style recalculation and layout and, frequently, are redundant thanks to the requirement that scripts poll for this information.
10
10
11
11
A body of common practice has evolved that relies on these behaviors, however, including (but not limited to):
12
12
@@ -164,7 +164,7 @@ function init() {
164
164
// Notify when a scroll-item gets within, or moves beyond, 500px from the visible scroll surface.
165
165
var opts = {
166
166
root:document.querySelector(".container"),
167
-
rootMargin:"500px 0px"
167
+
rootMargin:"500px 0px"
168
168
};
169
169
var observer =newIntersectionObserver(manageItemPositionChanges, opts);
Copy file name to clipboardExpand all lines: polyfill/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,16 +61,16 @@ There are, however, additional use cases that the default configuration will not
61
61
62
62
If you need to handle any of these use-cases, you can configure the polyfill to poll the document by setting the `POLL_INTERVAL` property. This can be set either globally or on a per-instance basis.
63
63
64
-
**Enabling polling for all instance:**
64
+
**Enabling polling for all instances:**
65
65
66
-
To enable polling for all instance, set a value for `POLL_INTERVAL` on the `IntersectionObserver` prototype:
66
+
To enable polling for all instances, set a value for `POLL_INTERVAL` on the `IntersectionObserver` prototype:
67
67
68
68
69
69
```js
70
70
IntersectionObserver.prototype.POLL_INTERVAL=100; // Time in milliseconds.
71
71
```
72
72
73
-
**Enabling polling for individual instance:**
73
+
**Enabling polling for individual instances:**
74
74
75
75
To enable polling on only specific instances, set a `POLL_INTERVAL` value on the instance itself:
76
76
@@ -94,7 +94,7 @@ var io = new IntersectionObserver(callback);
94
94
io.USE_MUTATION_OBSERVER=false;
95
95
```
96
96
97
-
This is recommended in cases where the DOM will update frequently but you know those updates will have no affect on the position or your target elements.
97
+
This is recommended in cases where the DOM will update frequently but you know those updates will have no effect on the position or your target elements.
98
98
99
99
100
100
## iframe support
@@ -171,7 +171,7 @@ Legacy support is also possible in very old browsers by including a shim for ES5
With these polyfills, `IntersectionObserver` has been tested an known to work in the following browsers:
174
+
With these polyfills, `IntersectionObserver` has been tested and known to work in the following browsers:
175
175
176
176
<table>
177
177
<tr>
@@ -210,4 +210,4 @@ With these polyfills, `IntersectionObserver` has been tested an known to work in
210
210
211
211
To run the test suite for the `IntersectionObserver` polyfill, open the [`intersection-observer-test.html`](./intersection-observer-test.html) page in the browser of your choice.
212
212
213
-
If you run the tests in a browser that support`IntersectionObserver` natively, the tests will be run against the native implementation. If it doesn't the tests will be run against the polyfill.
213
+
If you run the tests in a browser that supports`IntersectionObserver` natively, the tests will be run against the native implementation. If it doesn't, the tests will be run against the polyfill.
0 commit comments