2017-08-17 100 views
0

我在textarea上使用CKEditor。无论何时载入页面,textarea都会以适当的形式呈现为CKEditor。CKEditor加载时加载微调框

我想有一个加载微调器动画显示,而编辑器加载时没有显示textarea,而不是弄乱textarea。

我遵循这里提到的方法 - https://ckeditor.com/forums/FCKeditor-2.x/Loading-Animation,但即使在编辑器正确渲染后,图像仍然旋转。另外,我希望textarea /编辑器在它最终呈现之前根本不显示。

你可以在这里查看小提琴:https://jsfiddle.net/mevzqwsa/10/

<html> 
    <body> 
     <div id="board" style="position:absolute; left:10px"> 
     <img src="http://i.stack.imgur.com/MnyxU.gif"> 
     </div> 
     <textarea id="editor1" name="editor1" rows="10" cols="80"></textarea> 
     <script src="//cdn.ckeditor.com/4.7.1/standard/ckeditor.js"></script> 
     <script> 
     function FCKeditor_OnComplete(editorInstance) { 
      document.getElementById('board').style.visibility = 'hidden'; 
     } 
     CKEDITOR.replace('editor1'); 
     </script> 
    </body> 
</html> 

由于一吨提前!

回答

2

您可以使用CKEDITOR.editor.instanceReady事件来实现:

CKEDITOR.replace('editor1', { 
    on: { 
     instanceReady: function(evt) { 
      document.getElementById('board').style.visibility = 'hidden'; 
     } 
    } 
}); 

Working fiddle

+0

没错。当编辑器实例完全初始化时,会触发instanceReady事件,并在其处理程序中删除微调器。 –