This is working in Chrome, Opera and IE.
Can you please help to fix it in FF?
The following shows the same issue. FF doesn't seem to like assigning DOM objects, but maybe its something else?
--Glen
Can you please help to fix it in FF?
Code:
var els = document.getElementsByClassName('myClass');
for (var i=0; i<els.length; ++i){
var node = els[i];
// FF falls here with TypeDefError:node is undefined
while (node.tagName.toUpperCase() != 'BODY') {
elLeft += node.offsetLeft;
elTop += node.offsetTop;
node = node.parentElement;
}
}
The following shows the same issue. FF doesn't seem to like assigning DOM objects, but maybe its something else?
Code:
while (els[i].tagName.toUpperCase() != 'BODY') {
elLeft += els[i].offsetLeft; // FF OK here
elTop += els[i].offsetTop; // Still OK
els[i] = els[i].parentElement; // FF falls here, TypeDefError
}
--Glen