intersection-observer 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -6
- package/intersection-observer.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
@@ -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
|
64
|
+
**Enabling polling for all instances:**
|
65
65
|
|
66
|
-
To enable polling for all
|
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
|
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
|
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
|
|
171
171
|
<script src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver"></script>
|
172
172
|
```
|
173
173
|
|
174
|
-
With these polyfills, `IntersectionObserver` has been tested
|
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
|
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.
|
package/intersection-observer.js
CHANGED
@@ -821,8 +821,8 @@ function removeEvent(node, event, fn, opt_useCapture) {
|
|
821
821
|
if (typeof node.removeEventListener == 'function') {
|
822
822
|
node.removeEventListener(event, fn, opt_useCapture || false);
|
823
823
|
}
|
824
|
-
else if (typeof node.
|
825
|
-
node.
|
824
|
+
else if (typeof node.detachEvent == 'function') {
|
825
|
+
node.detachEvent('on' + event, fn);
|
826
826
|
}
|
827
827
|
}
|
828
828
|
|
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "intersection-observer",
|
3
|
-
"version": "0.12.
|
3
|
+
"version": "0.12.1",
|
4
4
|
"description": "A polyfill for IntersectionObserver",
|
5
|
-
"main": "intersection-observer",
|
5
|
+
"main": "intersection-observer.js",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
8
8
|
"url": "git@github.com:w3c/IntersectionObserver.git"
|