Javascript problem

G

Guest

Guest
I'm running a JavaScript on my site that's working like a mouse-over. when the mouse is moved on it (links, in my case) the image changes to another. Everyone else seems to see it correctly... but it takes some while until it opens on my computer. Does anyibe has any advice to get it working on my computer? Thank you.
 

machow

Distinguished
Dec 31, 2007
28
0
18,580
i'm not really sure about the question but here's my try. there's something called preloading images, which is caching the image in the web browser's cache before the graphic is actually called onmouseover. here's the code from macromedia dreamweaver...

<script language="JavaScript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[ i ].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[ i ];}}
}
</script>

<body bgcolor="#FFFFFF" text="#000000" onLoad="MM_preloadImages('a','b')">

where a and b in the <body> tag are the graphics you want to preload. note that the above [ i ] has to make spaces because this forums interprets it as italics... remove the spaces.

maybe...

<<I Come And Go All The Time>><P ID="edit"><FONT SIZE=-1><EM>Edited by machow on 11/09/01 10:16 AM.</EM></FONT></P>