Topic: Enqueue-ing scripts

Preload Images

Here’s an easy way to manage your image preloads from anywhere in your PHP functions. We can simply build a globalized array of all image sources prior to outputting the page, then hook into the wp_footer action to output the required Javascript.

Each time your code encounters an image source that must be preloaded, simply call wpcx_add_preload_img($src) to add it to ... 

Read article