Posted By

Uzbekjon on 04/06/09


Tagged

javascript jquery


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

benrudolph
JakeCarter
vali29
YA
tomasdev


jQuery Preload Images


 / Published in: jQuery
 

URL: http://jquery-howto.blogspot.com/2009/02/preload-images-with-jquery.html

This script preloads images in your document or lets your to preload images by their url and insert or append them in your DOM tree later.

  1. // Insert preloaded image after it finishes loading
  2. $('<img />')
  3. .attr('src', 'imageURL.jpg')
  4. .load(function(){
  5. $('.profile').append( $(this) );
  6. // Your other custom code
  7. });

Report this snippet  

You need to login to post a comment.