Clinton, preloading does help - especially with mouseOver events as there is no delay the first time a user move his/her mouse over the image. Use the following function (preload) and call it using the body onLoad handler.
<html>
<head>
<title>Preloading</title>
<script type="text/javascript" language="javascript">
function preload() {
if (!document.images) return;
var ar = new Array();
var arguments = preload.arguments;
for (var i = 0; i < arguments.length; i++) {
ar[i] = new Image();
ar[i].src = arguments[i];
}
}
</script>
<body onLoad="preload('pic1.gif'
.
.
.
</body>
</html>
Main Topics
Browse All Topics





by: CFJNMHPosted on 2001-07-28 at 21:17:55ID: 6330700
Yes, that is if your using them in a swap or something that does't automatically load the image.
I usually use this method,
<img src="theImage" style="visibility: 'hidden'; position: 'absolute';">
you hide the image so its not seen and you make the position absolute so it doesn't take up any space.