Posted By

michaelx on 10/05/11


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

spee66
rmmjr


Using CSS instead of Javascript for Preloading Images


 / Published in: CSS
 

URL: http://forrst.com/posts/Using_CSS_instead_of_Javascript_for_Preloading_I-w0A

  1. /* CSS3 */
  2. .preload {
  3. background-image: url(images/image_01.png),
  4. url(images/image_02.png),
  5. url(images/image_03.png),
  6. url(images/image_04.png),
  7. url(images/image_05.png);
  8. background-position: -9999px -9999px;
  9. background-repeat: no-repeat;
  10. }
  11.  
  12. /* CSS2 */
  13. .preload-01{ background: url(images/image_01.png) no-repeat -9999px -9999px;}
  14. .preload-02{ background: url(images/image_02.png) no-repeat -9999px -9999px;}
  15. .preload-03{ background: url(images/image_03.png) no-repeat -9999px -9999px;}
  16. .preload-04{ background: url(images/image_04.png) no-repeat -9999px -9999px;}
  17. .preload-05{ background: url(images/image_05.png) no-repeat -9999px -9999px;}

Report this snippet  

You need to login to post a comment.