CodingIE weirdness - help meee

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Ally   
 To:  Ally      
30584.8 In reply to 30584.7 
Every time I reload it loads one less image. WTF ARGH
0/0
 Reply   Quote More 

 From:  Extrobe (ALDREDD)  
 To:  Ally      
30584.9 In reply to 30584.8 
each time i refresh it, the counter stops at a lower number!
0/0
 Reply   Quote More 

 From:  Ally   
 To:  Ally      
30584.10 In reply to 30584.8 
Hm, when I take out the stuff that works out the percentage I get a message saying "Stack overflow". Interesting.
0/0
 Reply   Quote More 

 From:  andy  
 To:  Ally      
30584.11 In reply to 30584.1 
try:

javascript code:
test[doneimgs].src = image_url[doneimgs]+"?r="+Math.random();


..where appropriate.
0/0
 Reply   Quote More 

 From:  Ally   
 To:  andy     
30584.12 In reply to 30584.11 

Already tried that, cheers. Instead I have a huge problem of "stack overflow at line 0", which a quick Google tells me is the kind of problem no-one ever seems to solve.

 

Or post saying how.

0/0
 Reply   Quote More 

 From:  Ally   
 To:  Ally      
30584.13 In reply to 30584.12 
Apparently it's because of recursion. Which my script has a lot of, as the function calls itself 23 times. How I can avoid this I don't know.
0/0
 Reply   Quote More 

 From:  andy  
 To:  Ally      
30584.14 In reply to 30584.13 
This seems to work fine, and with no recursion:

js code:
var t = new Array();
function fireloading() {
	image_url[0] = "images/bottom.en/welcome_off.png";
	image_url[1] = "images/bottom.en/events_off.png";
	image_url[2] = "images/bottom.en/photos_off.png";
	image_url[3] = "images/bottom.en/win_off.png";
	image_url[4] = "images/bottom.en/touch_off.png";
	image_url[5] = "images/bottom/options_off.png";
	image_url[6] = "images/bottom.en/welcome_on.png";
	image_url[7] = "images/bottom.en/events_on.png";
	image_url[8] = "images/bottom.en/photos_on.png";
	image_url[9] = "images/bottom.en/win_on.png";
	image_url[10] = "images/bottom.en/touch_on.png";
	image_url[11] = "images/bottom/options_on.png";
	image_url[12] = "images/bottom/alternate1.png";
	image_url[13] = "images/bottom/alternate1_left.png";	  
	image_url[13] = "images/bottom/alternate1_right.png";	
	image_url[14] = "images/bottom/alternate2.png";
	image_url[15] = "images/bottom/alternate2_left.png";	  
	image_url[16] = "images/bottom/alternate2_right.png";	  
	image_url[17] = "images/bottom/alternate3.png";
	image_url[18] = "images/bottom/alternate3_left.png";	  
	image_url[19] = "images/bottom/alternate3_right.png";	
	image_url[20] = "images/bottom/alternate4.png";
	image_url[21] = "images/bottom/alternate4_left.png";	  
	image_url[22] = "images/bottom/alternate4_right.png";		 
	image_url[23] = "images/bottom/options_left.png";
	totalimgs = image_url.length - 1;
 
 
	for (i=0;i<image_url.length;i++) {
		t[i] = new Image();
		t[i].onload = bang;
		t[i].src = image_url[i];
	}
}
function bang() {
	doneimgs++;
	if (doneimgs == totalimgs) {
		delete t;
		new Effect.BlindDown('bottombar',{duration: 0.5});
	}
}


bang! I dunno why it's double-spaced, the code-highlighter's getting freaky with it.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  andy     
30584.15 In reply to 30584.14 
quote:
I dunno why it's double-spaced, the code-highlighter's getting freaky with it.
One of the mods has added a double-spacing filter to annoy Trigger.
0/0
 Reply   Quote More 

 From:  Ally   
 To:  andy     
30584.16 In reply to 30584.14 

Chaars. I had a layout similar to that, but I think there's a bit of a problem with it.

 

Basically, the way I was doing it before loads the images in sequence, wheras that one kicks off the loading all the same time (I think). For some reason this causes IE to misbehave and stick at 91% on the odd reload, which would irritate me intensely.

 

Weirdly, I think I've found that the problem was the percentage display itself- setting the innerHTML property was causing the stack overflow. Now I've taken that out it all works. I think.

 

I strongly suspect I'll be reverting to your method eventually though- I can see this recursion thing coming back to haunt me.

0/0
 Reply   Quote More 

 From:  andy  
 To:  Ally      
30584.17 In reply to 30584.16 
Have only ever used all-at-once loops to preload images before - browsers should be able to handle it. I guess you could do a semi-recursion thing - load images in loops of 10 or something? I dunno. Good jazz it's working anyway.
0/0
 Reply   Quote More 

 From:  Ally   
 To:  andy     
30584.18 In reply to 30584.17 

http://dump.untogether.co.uk/New%20Ents/temp.htm

 

I hope it works, anyway.

0/0
 Reply   Quote More 

 From:  Extrobe (ALDREDD)  
 To:  Ally      
30584.19 In reply to 30584.18 
'stack overflow at line 0'?
0/0
 Reply   Quote More 

 From:  Ally   
 To:  Extrobe (ALDREDD)     
30584.20 In reply to 30584.19 

<destroys head against wall>

 

It works fine here. Argh. Ctrl-F5ed? The old HTML might be caching. Maybe.

0/0
 Reply   Quote More 

 From:  Extrobe (ALDREDD)  
 To:  Ally      
30584.21 In reply to 30584.20 
nah - still get the error
0/0
 Reply   Quote More 

 From:  andy  
 To:  Ally      
30584.22 In reply to 30584.20 
force-refreshing and still getting the stack overflow error. erk.
0/0
 Reply   Quote More 

 From:  Ally   
 To:  andy     
30584.23 In reply to 30584.22 

I have bowed down to the force of your greater wisdom. Bang! I'm so leaving the function as that.

 

http://dump.untogether.co.uk/New%20Ents/temp.htm

 

Please tell me that works.

0/0
 Reply   Quote More 

 From:  andy  
 To:  Ally      
30584.24 In reply to 30584.23 
yep yep, seems to be working fine in IE and Firefox here. bang!
0/0
 Reply   Quote More 

 From:  Ally   
 To:  andy     
30584.25 In reply to 30584.24 

Now I just need to see how to dynamically work out what images need to be added! B.. ollocks!

 

Oh, and chaars muchly for the help here. I would have been going for hours. So to speak.

0/0
 Reply   Quote More 

 From:  andy  
 To:  Ally      
30584.26 In reply to 30584.25 
cue trig coming along saying "no probs"...
0/0
 Reply   Quote More 

Message 30584.27 was deleted

Reply to All  
 

1–20  21–40  41–43

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats