JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

       
Jsmadeeasy Forums Home   Search   Login   Register   Member List  

 Search
   
  

Viewing Page 1. More matches available? Yes
Prev Next
1.Image preloads
Posted by shashgo on 10/20/2002 8:34:00 PM
Hey,
I have a wscript that has a hundred or so images to preload. Each of these image names might be existant or not, so I test the existence using img.onload and the nonexistence using img.onerror.

But the preloading of each image requires some time, otherwise they always give an error. So I coded a setTimeout with a delay.
But how would I know what is an appropriate delay? And even if I set the delay to an appropriate value, how can I kep the user ...
2.Script doesnt work consistenly
Posted by shashgo on 10/19/2002 2:32:00 PM
The following scipt works to some extent. I have a total of 134 images that I want the script to try and load. Some of these images are bogus and will not load or they might be non existant. So what I have done is store the number of successfully loaded images in variable numImages and ignore the ones that are in error.

The script works well for an image fcount of less than 17 where the value of numImages increments to 16 (17 minus 1, which is okay). The script does not ...
3.Problem with script
Posted by shashgo on 10/19/2002 1:08:00 PM
Help:
I can not figure out why the following script gives me an error (Ill mark the line and tell you what the error is). The error is in th efunction disp() and is
document.nisha.src=imgArray[Current].src;

The first time the script works as expected and I get the last image (#10) display. On the next iteration, I get the error at this line, that says
imgArr[...].src is null or not an object.

According to the script the value of ...
4.Image events
Posted by shashgo on 10/18/2002 9:13:00 AM
I cant figure out when to use imagee event handlers like onLoad(), onError(), onAbort() and complete.

I have a script to test these values for each image that is the src of a pic,

<html>
<head>
<title>Nisha</title>
<script language="javascript">
<!--
var pic=new Image();
for (i=1;i<=20;i++)
{
...
Prev Next