Jighead
6/4/2018 - 2:53 PM

Preload Images

Very easy way to preload images which are needed later (e.g. when a hover is performed).

$.preloadImages = function() {
  for (var i = 0; i < arguments.length; i++) {
    $("<img />").attr("src", arguments[i]);
  }
}

$.preloadImages("hoverimage1.jpg","hoverimage2.jpg");