解决ckeditor高度无法自适应的问题


function ReloadEditor()
{
    var oCKeditor=CKEDITOR.replace('txtcontent'),{toolbar:'Full'});  //实例化editor
     oCKeditor.on('instanceReady',function(event))                   //准备
    {
       var editor=event.editor;
       setTimeout(function(){     //延时加载
               if(!editor.element)
               {
                    setTimeout(arguments.callee,1);
                    return;
               }
               event.removeListener('instanceReady',this.callee);
               if(editor.name=='txtcontent')
               {
                    editor.resize(editor.container.getStyle('width'),CKEDITOR.document.getById('cke_'+'txtcontent').getParent().$.offsetHeight);         //重载高度计算高度
                }
            },0);
    },null,null,9999);
}


  

 //设置ckeditor只读

CKEDITOR.config.readOnly=true;

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM