A simple AngularJS module to make it easy to pre-load images to prevent the horrible waterfall effect: Demo.
bower install angular-preload-image
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-preload-image/angular-preload-image.min.js"></script>
angular.module('app', ['angular-preload-image']);
<div preload-bg-image="[URL]" default-image="[URL]" fallback-image="[URL]"></div>
<img preload-image ng-src="[URL]" default-image="[URL]" fallback-image="[URL]" />
MIT
Check out the demo for an example of pre-loading background images and pre-loading standard images with AngularJS.
- Ability to know when all pre-loaded images have finished loading within the page
- Extensive cross browser and device testing + fixes
Inspiration taken from Ben Nadel's post about pre-loading images.