Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

intersection observer api

let options = {
  root: document.querySelector('#scrollArea'),
  rootMargin: '0px',
  threshold: 1.0
}

let observer = new IntersectionObserver(callback, options);
// A threshold of 1.0 means that when 100% of the target is 
// visible within the element specified by the root option,
// the callback is invoked.
 
PREVIOUS NEXT
Tagged: #intersection #observer #api
ADD COMMENT
Topic
Name
2+4 =