bradwbowman
06-14-2007, 03:55 AM
Hi all and thanks,
I get the following error in my coding: I'm not sure if this means I have to declare this as a variable. It works fine in Firefox, but not in IE. Any suggestions or can anyone point me in the right direction? Thanks a bunch.
Line: 268
Error 'offsetParent.offsetLeft' is null or not an object
Code: 0
Here is the function
function hideElement( elmID, overDiv ) {
if(document.all) {
for(i = 0; i < document.all.tags( elmID ).length; i++) {
obj = document.all.tags( elmID )[i];
if(!obj || !obj.offsetParent) continue;
// Find the element's offsetTop and offsetLeft relative to the BODY tag.
LINE 268::) objLeft = obj.offsetLeft - overDiv.offsetParent.offsetLeft;
objTop = obj.offsetTop;
objParent = obj.offsetParent;
while(objParent.tagName.toUpperCase() != 'BODY') {
objLeft += objParent.offsetLeft;
objTop += objParent.offsetTop;
objParent = objParent.offsetParent;}
objHeight = obj.offsetHeight;
objWidth = obj.offsetWidth;
if((overDiv.offsetLeft + overDiv.offsetWidth) <= objLeft);
else if((overDiv.offsetParent.offsetTop + overDiv.offsetHeight + 20) <= objTop);
else if(overDiv.offsetParent.offsetTop >= eval(objTop + objHeight));
else if(overDiv.offsetLeft >= eval(objLeft + objWidth));
else {
obj.style.visibility = 'hidden';
}
}
}
}
I get the following error in my coding: I'm not sure if this means I have to declare this as a variable. It works fine in Firefox, but not in IE. Any suggestions or can anyone point me in the right direction? Thanks a bunch.
Line: 268
Error 'offsetParent.offsetLeft' is null or not an object
Code: 0
Here is the function
function hideElement( elmID, overDiv ) {
if(document.all) {
for(i = 0; i < document.all.tags( elmID ).length; i++) {
obj = document.all.tags( elmID )[i];
if(!obj || !obj.offsetParent) continue;
// Find the element's offsetTop and offsetLeft relative to the BODY tag.
LINE 268::) objLeft = obj.offsetLeft - overDiv.offsetParent.offsetLeft;
objTop = obj.offsetTop;
objParent = obj.offsetParent;
while(objParent.tagName.toUpperCase() != 'BODY') {
objLeft += objParent.offsetLeft;
objTop += objParent.offsetTop;
objParent = objParent.offsetParent;}
objHeight = obj.offsetHeight;
objWidth = obj.offsetWidth;
if((overDiv.offsetLeft + overDiv.offsetWidth) <= objLeft);
else if((overDiv.offsetParent.offsetTop + overDiv.offsetHeight + 20) <= objTop);
else if(overDiv.offsetParent.offsetTop >= eval(objTop + objHeight));
else if(overDiv.offsetLeft >= eval(objLeft + objWidth));
else {
obj.style.visibility = 'hidden';
}
}
}
}