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
+3-3
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ 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
13
13
* Observing the location of "below the fold" sections of content in order to lazy-load content.
14
14
* Implementing data-bound high-performance scrolling lists which load and render subsets of data sets. These lists are a central mobile interaction idiom.
15
-
* Calculating element visibility. In particular, [ad networks now require reporting of ad "visibility" for monetizing impressions](http://www.iab.net/iablog/2014/03/viewability-has-arrived-what-you-need-to-know-to-see-through-this-sea-change.html). This has led to many sites abusing scroll handlers, [synchronous layout invoking readbacks](http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html), and resorting to exotic plugin-based solutions for computing "true" element visibility (as a fraction of the element's intended size).
15
+
* Calculating element visibility. In particular, [ad networks now require reporting of ad "visibility" for monetizing impressions](https://www.iab.com/news/viewability-has-arrived-what-you-need-to-know-to-see-through-this-sea-change/). This has led to many sites abusing scroll handlers, [synchronous layout invoking readbacks](https://gist.github.com/paulirish/5d52fb081b3570c81e3a), and resorting to exotic plugin-based solutions for computing "true" element visibility (as a fraction of the element's intended size).
16
16
17
17
These use-cases have several common properties:
18
18
@@ -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);
0 commit comments