PDA

Click to See Complete Forum and Search --> : Image Loading Problem


winapi
Feb 26th, 2001, 11:33 PM
Hi,
I am trying to create a simple toolbar with about 10 images. I have a simple table with img tags in it. The problem is once the page loads, one or many of the images at random do not come up. If I refresh the page other may not work (seems to be random.). Any ideas???

<table>
<tr>
<td><img name="pic1" src="pic1"></td>
<td><img name="pic2" src="pic2"></td>
ect...
</tr>
</table>

Lord Orwell
Feb 27th, 2001, 01:33 AM
um. Have you tried precaching the images?

winapi
Feb 27th, 2001, 02:09 AM
Hi,
I was not using any routine to preload images, but I just wrote one and am still having the same problem.
Please take a look and tell me what you think.

<SCRIPT>
function PreLoadImages()
{
var ImageList = new Array("images/newfile.gif","images/openfile.gif","images/savefile.gif","images/bold.gif","images/italic","images/underline.gif","images/cut.gif","images/copy","images/paste.gif","images/center.gif","images/right","images/left.gif");

var PreLoader = new Array(15);
for (x=0;x < ImageList.length;x++)
{
PreLoader[x] = new Image();
PreLoader[x].src=ImageList[x];
}
}
</SCRIPT>
</head>
<BODY onLoad="PreLoadImages();">
<table border="1">
<tr>
<td><img name="img1" src="images/newfile.gif" border="0"></td>
<td><img name="img2" src="images/openfile.gif" border="0"></td>
<td><img name="img3" src="images/savefile.gif" border="0"></td>
<td><img name="img4" src="images/bold.gif" border="0"></td>
<td><img name="img5" src="images/italic.gif" border="0"></td>
<td><img name="img6" src="images/underline.gif" border="0"></td>
<td><img name="img7" src="images/cut.gif" border="0"></td>
<td><img name="img8" src="images/copy.gif" border="0"></td>
<td><img name="img9" src="images/paste.gif" border="0"></td>
<td><img name="img10" src="images/left.gif" border="0"></td>
<td><img name="img11" src="images/center.gif" border="0"></td>
<td><img name="img12" src="images/right.gif" border="0"></td>
</tr>
</table>

Lord Orwell
Feb 27th, 2001, 03:00 AM
hmm. I am no expert, but i dont see anything wrong. Perhaps you can avoid this problem by having one image with hotspots.

JoshT
Feb 27th, 2001, 07:05 AM
Try setting the height and width for the images and see what happens.

Josh

winapi
Feb 27th, 2001, 09:48 PM
I have found out that my images actually load. If you right click on a image that did not display and choose properties, it has a size, but displays the square and red X. If I right click on a picture that did not load and choose show picture, it appears. Anyone have any clue what the deal is here???


Thanks
Richard