Skip to content

Instantly share code, notes, and snippets.

@jmahc
Created July 13, 2015 15:54
Show Gist options
  • Save jmahc/bd990d982d847daf4376 to your computer and use it in GitHub Desktop.
Save jmahc/bd990d982d847daf4376 to your computer and use it in GitHub Desktop.
Preload images
$.fn.preload = function () {
this.each(function () {
$('<img/>')[0].src = this;
});
}
Site.home = {}
Site.home.init = function () {
var t = this;
t.init_variables();
t.init_methods();
}
Site.home.init_variables = function () {
var t = this;
}
Site.home.init_methods = function () {
var t = this;
$([
'/Images/Home/home_bg1.jpg',
'/Images/Home/home_bg2.jpg'
]).preload();
}
Site.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment