preloading a image
Posted: Sat May 21, 2011 8:48 am
hy guys, i was searching for a javascript or somting to preload a image, an i found this, wich goes in the head of the page:
thanks.
<SCRIPT language="JavaScript"> <!-- pic1= new Image(100,25); pic1.src="img/bg1.png"; //--> </SCRIPT>and this needs to go in the body part pf the page where the image is diplayed:
<SCRIPT language="JavaScript"> <!-- if (document.images) { pic1= new Image(100,25); pic1.src="http://someplace.com/image1.gif"; } //--> </SCRIPT>but my image is in the css, in the body tag, so how can i change this so that it will work, or how sould i added to the css?
thanks.