Skip to content

Instantly share code, notes, and snippets.

@jpescada
Last active August 19, 2020 13:03
Show Gist options
  • Save jpescada/1baec1a63bf613a6049231ec739bf10c to your computer and use it in GitHub Desktop.
Save jpescada/1baec1a63bf613a6049231ec739bf10c to your computer and use it in GitHub Desktop.
Load third-party JS scripts only after first scroll
window.addEventListener('scroll', () =>
setTimeout(() => {
// Load Fullstory, Intercom, Segment, etc
}, 1000),
{ once: true }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment