MCPcopy Create free account
hub / github.com/codrops/OnScrollShapeMorph / preloadImages

Function preloadImages

js/utils.js:7–12  ·  view source on GitHub ↗
(selector = 'img')

Source from the content-addressed store, hash-verified

5 * @returns {Promise} - Resolves when all specified images are loaded.
6 */
7const preloadImages = (selector = 'img') => {
8 return new Promise((resolve) => {
9 // The imagesLoaded library is used to ensure all images (including backgrounds) are fully loaded.
10 imagesLoaded(document.querySelectorAll(selector), {background: true}, resolve);
11 });
12};
13
14/**
15 * Linear interpolation

Callers 1

index.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected