You are not logged in.
Pages: 1
How can you determine the offset of the actual HTMLArea (i.e. offsetTop and offsetLeft, etc.) I checked the _textarea, _htmlarea, and _iframe but all of them have a 0 offset.
Thank you for your help.
Offline
offsetTop/Left is the offset from the parent element isn't it? I think you should add up all the offsetTop's/Lefts back to the root element and that would give what you want.
James Sleeman
Offline
Thank you, the trick was to both accumulate the distance inside the _htmlArea but also take into account the height of the _toolbar. The code snipped I ended up with was:
var xx = xinha_editors['MyTextFieldsId']._htmlArea;
var ol = 0, ot = 0;
while(typeof xx.tagName != 'undefined')
{
ot += xx.offsetTop;
ol += xx.offsetLeft;
xx = xx.parentNode;
}
var htmlareaOffsettop = ot + xinha_editors['HTMLEditor']._toolbar.offsetHeight;
var htmlareaOffsetleft = ol + el.offsetLeft;
Offline
Pages: 1