|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
function leftchange() {
var leftimages = new Array(3); for(var i = 0; i < 3; i++) { leftimages[i] = new Image(); leftimages[i].src = "images/left" + i + ".gif"; } var random = Math.floor(Math.random()*3); left.src = leftimages[random].src; setTimeout(leftchange, 3000); } There's my code. It is located in the head. In the body, I use an onLoad to call the function. Later on in the actual document, I call and <img name="left" src="whatever" width and height stuff> Anyhow - ie 5.01 likes my code and causes the image to change. Netscape gives me an error saying that left is not defined and another person, unknown IE version was able to tell that img's were downloading, but not changing. I'm not too good w/ JavaScript and so I'm hoping that someone can help me with this problem. Thanx. |
|
#2
|
||||
|
||||
|
are your images in a <div></div> (layer)?
if so you need to explicitly tell netscape where the image is so while , if(document.all){ document.images[img_name].src =img_src } else { document[img_name].src=img_src } works when there is only 1 layer you need - if (document.all) { document.images[img_name].src=img_src } else { document[div].document[img_name].src=img_src } for nested or multiple layers. hope that helps? ------------------ Simon Wheeler FirePages -DHTML/PHP/MySQL |
|
#3
|
|||
|
|||
|
But in most cases, the easiest way is type document.left.src=.... instead of left.src alone, this way, you don't have to add anything else to your script
It works in NS [This message has been edited by Argrajoca (edited April 19, 2000).] |
|
#4
|
|||
|
|||
|
Thanx for y'alls help.
I appreciate it. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > IE 5.01 likes my code -> other's don't. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|