Is there a way to force a browser to download an image when it opens a page, that isn't included in a page? I have a mouseover function with javascript that causes the image to appear but I don't want a delay so I need the image to load beforehand. Any help is appreciated.
If it's an image rollover, doing this using CSS might be better for you. Doing it this way, the rollover only uses 1 image, instead of 2, meaning it wouldn't have to load a 2nd image. If this is what you need let me know and I can give you the info or find a link with it.
If i understand you right use in the head section something like: <script language="javascript"> var im = new image(); im.src = 'somepath/somefilename'; </script> HTML: This will force the browser to pre-load the image into memory
Yep, that's the way to do it. Just use background-position, and have it shift your button image to display another image. More info: http://www.redvodkajelly.com/blog/2007/06/15/css-image-rollovers/
It's actually an OnClick function; I guess I will look into the CSS way of doing it. thanks for your help.
So I decided to use javascript because my page involves multiple thumbnails that cause a full image to load. I have the following inside the <head> tags: <script language="javascript"> var im = new image(); im.src = 'image.jpg'; </script> And I replaced, in the body of my page: onMouseDown="document.images.Pic.src='image.jpg'" with onMouseDown="document.images.Pic.src=im.src" (This code is inside a <span> tag that spans the thumbnail.) For some reason this isn't working. It was before, but there was a lag. Now the image doesn't load at all. I'm wondering if it isn't a code issue (I'm not very experienced with java). thanks again