UNPKG

apex4x

Version:

The Comprehensive ARIA Development Suite

31 lines 2.33 kB
�� Function: preloadImages(domElementOrStringMarkup) Shorthand: preload(domElementOrStringMarkup) Description: Will preload embedded images into the DOM in preparation for instant rendering later. Returns: Unmodified Object. Note: The preloadImages() function will parse HTML markup or query a DOM container element to locate all <img/> elements and preload these within the page so they download before they are meant to be rendered. This ensures instant renderring when they are meant to be seen visually. Example: // Preload images within HTML markup. $A.preloadImages('<div class="carousel-slide-1"><img src="file/path/slide1.jpg" /></div>'); // Preload images within a DOM container element. $A.preloadImages(domContainerElement); // Or the same using chaining // Preload images within HTML markup. var myChain = $A('<div class="carousel-slide-1"><img src="file/path/slide1.jpg" /></div>').preloadImages(); // Preload images within a DOM container element. var myChain = $A(domContainerElement).preloadImages(); // To return the modified object within a chain, use the "return()" method. var myObject = myChain.return();