<table role="presentation" id="teaser_tbl" class="mceLayout" cellspacing="0" cellpadding="0" style="width: 590px; height: 100px; ">
정확하게 변경해야하는 요소입니다. Tinymce에는 width와 height init 매개 변수가 있지만이 설정이 충분하지 않은 경우가 있습니다. 편집기 iframe이 명시 적으로 동일한 높이를 할당 받음으로 인해 iframe도 조정해야합니다. 전화해야합니다
var new_val = '30px';
// adjust table element
$('#' + 'my_editorid' + '_tbl').css('height', new_val);
//adjust iframe
$('#' + 'my_editorid' + '_ifr').css('height', new_val);
Idealy,이 작업은 편집기 초기화시 바로 수행해야합니다. 그래서 사용
tinyMCE.init({
...
setup : function(ed) {
ed.onInit.add(function(ed, evt) {
var new_val = '30px';
// adjust table element
$('#' + ed.id + '_tbl').css('height', new_val);
//adjust iframe
$('#' + ed.id + '_ifr').css('height', new_val);
});
}
});
업데이트 : jQuery를하지 않고 솔루션 :
tinyMCE.init({
...
setup : function(ed) {
ed.onInit.add(function(ed, evt) {
var new_val = '30px';
// adjust table element
var elem = document.getElementById(ed.id + '_tbl');
elem.style.height = new_val;
// adjust iframe element
var iframe = document.getElementById(ed.id + '_ifr');
iframe.style.height = new_val;
});
}
});
+1 좋은 질문 – Thariama