Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Created November 7, 2013 14:35
Show Gist options
  • Select an option

  • Save mikedugan/7355556 to your computer and use it in GitHub Desktop.

Select an option

Save mikedugan/7355556 to your computer and use it in GitHub Desktop.
gradually loads in images
jQuery.fn.loadComplete = function (fn) {     return this.each(function () {         if (this.complete || this.readyState == 'complete') {             fn.call(this);         } else {             $(this).load(fn);         }     }); }; $('img').loadComplete(function(){    $(this).fadeIn(800); }); //don't forget to initially hide them!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment