:: Forum >>

Help with Javascript error: 'obj' is null or not an object


I have a number of show/hide images on my site which allows the user to click on various thumbnails to open up the full image using layer based styles.

However, my Javascript seems to have developed an error saying that the object has no properties and then takes me to the following line of code:

obj.visibility='hidden';

This code was written for me so that i could use the script dynamically with PHP an alter the number of div layers it needed to generate.

The full(?) javascript for this function is:

function showImg(myShow)
{
var loopNum=99;
for (x=1; x<=(loopNum); x++) //1 based loop
{
myImg = "image" + x;
if ((obj=MM_findObj(myImg))!=null)
{
if (obj.style){obj=obj.style;}
}
if (x == myShow)
{//show it!
obj.visibility='visible';
}else{//hide it!
obj.visibility='hidden';
}
}
}

I would be enorumously grateful if someone could help me here to pinpoint the error. Let me know if I have missed out any detail/code

Lee
Edit/Delete Message
Lee
Wednesday, August 17, 2005

This topic is archived.


Back to support forum

Forum search