Closed Thread Icon

Preserved Topic: Preload Problems (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17756" title="Pages that link to Preserved Topic: Preload Problems (Page 1 of 1)" rel="nofollow" >Preserved Topic: Preload Problems <span class="small">(Page 1 of 1)</span>\

 
r@m
Maniac (V) Inmate

From:
Insane since: May 2000

posted posted 06-07-2000 20:39

I'm having few problems with this code, apparently somewhere there is a line where i can change the number of images to preload, it should be marked , but it's not......
I can get this to work , but if i use more than 4 images ..it locks.......I need to be able to tell the script that i'm using say.............26-40 images.
I've tried the site I got this from , but no reply.....
Can anyone point out the line....or lines ?

Thanks..........

<script language="JavaScript">
<!--
vers = 1.0;
// -->
</script>
<script language="JavaScript1.1">
<!--
vers = 1.1;
// -->
</script>
<script language="javascript">
<!--
function initArray() {
for (var i = 0; i < initArray.arguments.length; i++)
this[i] = initArray.arguments[i];
this.length = initArray.arguments.length;
}
var pics = new initArray(
"status1.jpg",
"status2.jpg",
"status3.gif",
"status4.gif");

var transfer_url = "script.htm"; // URL of second page goes here

function transfer(param) {
if (vers>1.0)
location.replace(transfer_url);
else
location.href = transfer_url;
}

function done() {
if (vers < 1.1)
transfer();
else
commence_loading();
}

function commence_loading() {
for (g=0;g<pics.length;g++)
eval('document.preload'+g+'.src = "'+pics[g]+'";');
}

// preload the status bar images
if (vers >= 1.1) {
blue = new Image();
blue.src = "blue.gif";
black = new Image();
black.src = "black.gif";
}

var loaded = new Object();
for (h=0;h<pics.length;h++)
loaded[h] = 0;
num_loaded = 0;

function update(num) {
loaded[num]++;
if (loaded[num] == 2) {
eval('document.status'+num_loaded+'.src = "blue.gif";');
num_loaded++;
if (num_loaded == pics.length)
transfer();
}
}
// -->
</script>
</head>
<body bgcolor="#ffffff" onLoad="done()">
<center><br>
<font size=+1 face="Arial,Helvetica">
Please be patient while some images<br>
are preloaded. Thank you.</font><br><br>

<script language="JavaScript">
<!--
if (vers < 1.1) {
document.write('What a pitiful browser you have! Get Netscape 3 or above to see<br>'
+ 'all the great stuff on this site');
for (j=0;j<pics.length;j++) {
document.write('<img src="'+pics[j]+'" width=1 height=1>');
}
} else {
document.write('<table><tr><td><b>status:</b> '
+ '<img src="blue.gif" width=15 height=10>');
for (k=0;k<pics.length;k++)
document.write('<img src="black.gif" width=30 height=10 name="status'+k+'">');
document.write('</td></tr></table><br>'
+ '<a href="'+transfer_url+'">I can\'t wait</a>');
for (j=0;j<pics.length;j++) {
document.write('<img src="black.gif" width=1 height=1 '
+ 'onLoad="update('+j+')" name="preload'+j+'">');
}
}
// -->
</script>

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-08-2000 01:37

Ouch, that's some old code - it's made to support JS 1.0... I doubt more than 5% of the population uses a browser that needs 1.0 to be supported.

I looked it over, as best I could, and I can't see why it won't work, if you just add the extra image names into the array. Can we see this in action? Especially with the error? That's always helpful.

r@m
Maniac (V) Inmate

From:
Insane since: May 2000

posted posted 06-08-2000 02:21

Thanks Slime.....yeah it is a bit old, but it seemed to be what i was looking for, he..but what do i know <img border=0 align=absmiddle src="http://www.ozones.com/forum/smile.gif">
I'll post it tommorow.
btw i got it from here if that's a help .... http://www.infohiway.com/javascript/status/index.htm
Thanks for checking it out.

r@m
Maniac (V) Inmate

From:
Insane since: May 2000

posted posted 06-08-2000 19:26

Here's the scripts..one working (default), the other with 16 images...
http://ramdesign.8k.com/interfaces/slide/scriptprob.htm

Does anyone know af a better script, maybe this things just to old. <img border=0 align=absmiddle src="http://www.ozones.com/forum/frown.gif">
tkx

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 06-09-2000 01:22

Well, CNET's builder.com may not make the BEST code, but if you are just preloading your images, use their mouseover machine, and take the preloading area from the code they automatically write for you. It ain't half bad.




Lepricosa...The Leprosy Ointment. For when your not half the man you used to be.

r@m
Maniac (V) Inmate

From:
Insane since: May 2000

posted posted 06-09-2000 01:40

I want the full page to load...before the page loads (if that makes sense) ...it's for a new interface that need s to be preloaded ....over 250k..........
( about 40 images)I want the graphics to be fully loaded when the page loads.....if that's possible .........

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 06-09-2000 06:58

250k? Ouch! <img border=0 align=absmiddle src="http://www.ozones.com/forum/redface.gif">

r@m
Maniac (V) Inmate

From:
Insane since: May 2000

posted posted 06-09-2000 19:18

It's ok i've found a workaround ...thanks anyway.......... <img border=0 align=absmiddle src="http://www.ozones.com/forum/smile.gif">

« BackwardsOnwards »

Show Forum Drop Down Menu