grabmail
06-09-2006, 08:03 PM
var curtop = 0;
if (obj.offsetParent) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
obj = obj.offsetParent;
}
}
else if (obj.y)
{
curtop += obj.y;
}
return curtop;
Can anyone tell me what's wrong with the above code? I'm trying to display a DIV below a textfield but after i move from HTML 4.0 to XHTML 1.0 strict, the position is all wrong.
In IE, it is positioned in the middle of the textfield.
In Firefox, it is positioned at the bottom of the page.
If i add <?xml version="1.0" encoding="UTF-8"?> above doctype,
it'll work fine in IE but not in Firefox.
Anyone has this problem before?
if (obj.offsetParent) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
obj = obj.offsetParent;
}
}
else if (obj.y)
{
curtop += obj.y;
}
return curtop;
Can anyone tell me what's wrong with the above code? I'm trying to display a DIV below a textfield but after i move from HTML 4.0 to XHTML 1.0 strict, the position is all wrong.
In IE, it is positioned in the middle of the textfield.
In Firefox, it is positioned at the bottom of the page.
If i add <?xml version="1.0" encoding="UTF-8"?> above doctype,
it'll work fine in IE but not in Firefox.
Anyone has this problem before?
