handelEditor=function(editor)
{
var edit = editor.edit;
var doc = edit.doc;
var body = doc.body;
var ifr = edit.iframe[0];
var ofrBox = ifr.parentNode;
var minHeight = parseInt(editor.height,10);
// ift.style.height = '100%' 我在创建编辑器的时候就设置100%了. 如果创建时候没有设置可以用这段代码
var span = G.getElement('span', body)[0], tmpNode,
lastHeight = 0,
currentHeight,
if (!span) {
span = doc.createElement('span');
span.style.cssText = 'display:block;width:0;margin:0;padding:0;border:0;clear:both;';
span.innerHTML = '.';
}
tmpNode = span.cloneNode(true);
body.appendChild(tmpNode);
currentHeight = (Math.max((G.offset(tmpNode).top + tmpNode.offsetHeight) , minHeight));
if (currentHeight != lastHeight) {
console.log(currentHeight)
G.css(body, {'height':currentHeight}); //G.css 是我自己封装的, 可以style.height = currentHeight 来设置
G.css(ofrBox, {'height':currentHeight});
lastHeight = currentHeight;
}
tmpNode.parentNode.removeChild(tmpNode);
};