My goal is to have an image preload while it is loading the actualy image, but I can't quite figure it out. The whole goal for this is that I have a slideshow that displays an image, but sometimes it is slow to load.. lol. Here's my HTML:\[code\]<div id="slideshow"> <img src="http://stackoverflow.com/questions/images/slideshow/spacer.gif" width="100" height="100" id="myPicture" alt="some image"></div>\[/code\]Here's my javascript I have already:\[code\]window.onload = choosePic;function choosePic() { var myPix = new Array("../images/slideshow/sempiternal.png", "../images/slideshow/cross.png", "../images/slideshow/pentagram.png"); var randomNum = Math.floor((Math.random() * myPix.length)); document.getElementById("myPicture").src = http://stackoverflow.com/questions/13774092/myPix[randomNum];}\[/code\]And the CSS:\[code\]#slideshow { height: 100px; width: 100px; position: fixed; bottom: 20px; right: 20px;}\[/code\]