예, 가능합니다. 여기
이 몇 가지 정보를 얻을 수
getBoundingClientRect()
를 사용하는 방법의 예입니다
var ed = tinymce.get('text_box_desc0');
// this will take the first table in the editor, you may define another selector to get 'your' table element
var elem = $(ed.getBody()).find('table:first').get(0);
try {
box = elem.getBoundingClientRect();
}
catch(e)
{
console.log('error creating box: ' + e);
}
// various info
var doc = ed.getDoc(),
docElem = doc.documentElement,
body = ed.getBody(),
win = ed.getWin(),
clientTop = docElem.clientTop || body.clientTop || 0,
clientLeft = docElem.clientLeft || body.clientLeft || 0,
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
top = box.top + scrollTop - clientTop,
left = box.left + scrollLeft - clientLeft;
당신이 찾고있는 무슨
box.width;
하지만
box.height;
같은 더 많은 속성이있다 고마워요.하지만 다음 오류가 발생합니다. '오류 생성 상자 : TypeError : elem.getBoundingClientRect is not function ' elem 테이블에 – RMcLeod
어떤 브라우저를 사용하고 있습니까? – Thariama
Mac OS X의 Firefox 16.0.2 – RMcLeod