设置CKEditor的高度

var h = document.getElementById('content').offsetHeight; //得到textarea的高度
CKEDITOR.replace('content', {height:'100%'});//设置height:100%没用
CKEDITOR.on('instanceReady', function (e) {
var td = document.getElementById('cke_contents_' + e.editor.name), tbody = td.parentNode.parentNode;
td.style.height = h - tbody.rows[0].offsetHeight - tbody.rows[2].offsetHeight + 'px';
})

 

posted @ 2014-03-04 09:36  jeffrey77  阅读(1028)  评论(0编辑  收藏  举报