It worked fine in FF, but keep getting an error in IE
Object required, in JS file, Line 21, Char 8;
.
function ShowBox(id, num)
{
var i;
var bigIMG = new Array(num);
for(i=0; i<=bigIMG.length; i++){
bigIMG[i] = "c" + i;
var thisBig = bigIMG[i];
if(bigIMG[i] == id){
obj = document.getElementById(thisBig);
obj.style.display = 'block';
}else{
obj2 = document.getElementById(thisBig);
obj2.style.display = 'none'; // line 21
}
}
}
if I change the code: for(i=0; i<=bigIMG.length; i++)
to for(i=0; i<bigIMG.length; i++)
, the error will go away, however, the last item in the array which is bigIMG[num], its display will not be set to "none".
Any suggestion will be appreciated!