解決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