Skip to content

lazyLoad

Mike Byrne edited this page Jan 25, 2022 · 5 revisions

description

A A17-helperised version of: https://github.com/area17/lazyload (v2.1.1 / 2018-04-01)

requires

  • nothing

parameters

optional settings object:

  • pageUpdatedEventName - event to listen for page updated events to retrigger
  • elements - string of elements to search for to lazy load in
  • rootMargin - IntersectionObserver option
  • threshold - IntersectionObserver option
  • maxFrameCount - frequency of operation

See https://github.com/area17/lazyload

returns

  • nothing

example usage:

lazyLoad();

Or, with options:

lazyLoad({
  pageUpdatedEventName: 'spfdone',
  elements: 'img[data-src]',
  rootMargin: '0px 0px 30% 0px',
  threshold: 0.1,
  maxFrameCount: 2,
});