Below is a clumsy (but working) attempt of getting the offsetTop of an element that is repeated many times within the document.
The question is : was there another simpler method, without the need of a loop for instance?
Code:
document.onmousemove = function(ev){
if (currenttable && currenttable.dragObject) {
var elems = currenttable.dragObject.getElementsByTagName('div');
for (var i=0; i<elems.length; i++) {
if (elems[i].getAttribute( 'id' ) == 'bottom-area') {
currenttable_height = elems[i].offsetTop;
}
}
I've tried
var elem = currenttable.dragObject.getElementById('bottom-area');
but it throws an error ("... is not a function")
Thanks!