Hello,
I have been searching the posts & web, but haven't found a solution to this. I'm almost loony tunes, so I figured I'd start a post. The following:
works fine in FireFox to correctly position the div. However, in IE offsetleft and offsettop always return 0. The do while loop walks up the "food chain" of divs and table cells.
Any ideas?
Thnaks in advance,
Andrew
"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
I have been searching the posts & web, but haven't found a solution to this. I'm almost loony tunes, so I figured I'd start a post. The following:
Code:
function createAptBoxes() {
var curTop=0,curLeft=0;
document.write("<div id='apt1' class='aptBox'>Start: " + apt1start + "<br>Subject: " + apt1subject + "<br>");
document.getElementById('apt1').style.height = ((40/60)*apt1duration + ((apt1duration/60)*3)) + "px";
obj = document.getElementById(apt1start);
if(obj.offsetParent) {
do {
curLeft += obj.offsetLeft;
curTop += obj.offsetTop;
} while(obj = obj.offsetParent)
document.getElementById('apt1').style.left = curLeft - 4 + "px";
document.getElementById('apt1').style.top = curTop + 1 + "px";
}
}
Any ideas?
Thnaks in advance,
Andrew
"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws