2014-12-21 62 views

回答

0

雖然檢查它不支持尚未設置高度%的CKEditor的文檔http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-height所以爲了得到所需的結果,我建議通過CSS設置高度爲100%而不是ckedtior.config使用javascript讀取屏幕高度,設置負載和窗口大小調整大小並將其作爲值放入外部元素高度。

可能聽起來像很多工作,但並不像棘手。 Updated fiddle here

CSS添加(讓你可能具有加載網頁上的所有ckeditors)

div[id^=cke_editor] { 
    height:100%; 
} 

JavaScript設置外div的高度在頁面加載

document 
    .getElementById("outer") 
    .style.height = window.innerHeight+"px"; 

如果你想有這個工作window resize我建議使用jQuery,但是你可以不用。下面是如何(有和沒有jQuery):Cross-browser window resize event - JavaScript/jQuery

+0

視覺上這個按照需要工作,但是當我在ckeditor中鍵入文本時,編輯器的大小仍然小於屏幕高度的一半,即按下'enter '〜5次 – bobbyrne01

+0

@ bobbyrne01 damm verry true,你試過這個:http://stackoverflow.com/questions/1546408/ckeditor-3-0-height – caramba