WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Preload images with JavaScript, Nicolaas, May 31, 2005
     Re:Preload images with JavaScript, Erik Arvidsson, June 5, 2005

Subject: Re:Preload images with JavaScript From: Erik Arvidsson Date: June 5, 2005
You can use onload, onerror and onabort to figure out when the image is loaded.

var img = new Image;
img.src = "...";
img.onload = function () { ... };
img.onerror = function () { ... };
img.onabort = function () { ... };

erik



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX