2011-12-23 127 views
4

當我在彈出窗口(colorbox或fancybox)中打開CKEditor時,它第一次可以正常工作。當在彈出窗口中第二次打開時,CKEditor不可編輯

當彈出窗口關閉並第二次打開時,內容區域不可點擊/可編輯且不顯示內容。

但內容顯示,當我點擊「源」按鈕,然後在設計視圖中可用。這在IE和Firefox中很好,但問題在於CHROME。

我跟在CKEditor loading in Colorbox not working [ Google Chrome ]中說了什麼,但我仍然有這個問題。

下面是我在我的應用程序的示例代碼:

<html> 
<head> 
    <title>CKEditor Sample</title> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> 
    <script type="text/javascript" src="http://ckeditor.com/apps/ckeditor/3.6.2/ckeditor.js?1324772165"></script> 

    <link href="http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" media="screen" /> 

    <script type="text/javascript" src="http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.js"></script> 

    <script type="text/javascript"> 

     $(function() { 
      if (CKEDITOR.instances['taCKEditor']) { 
       delete CKEDITOR.instances['taCKEditor']; 
      } 
      CKEDITOR.config.height = '500px'; 
      CKEDITOR.config.width = '500px'; 
      CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR; 
      CKEDITOR.config.shiftEnterMode = CKEDITOR.ENTER_P; 
      CKEDITOR.config.startupFocus = true; 
      CKEDITOR.config.baseFloatZIndex = 9000; 
      CKEDITOR.replace('taCKEditor', 
     { 
      uiColor: '#fdd1ad', 
      toolbar: 
      [ 
       ['Source', '-', 'NewPage', 'Preview'], 
       ['Cut', 'Copy', 'Paste', 'PasteText', '-', 'Print', 'SpellChecker'], 
       ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], 
       '/', 
       ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], 
       ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], 
       ['Link', 'Unlink', 'Anchor'], 
       ['Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'], 
       '/', 
       ['Styles', 'Format', 'Font', 'FontSize'], 
       ['TextColor', 'BGColor'] 
      ] 
     }); 

      $("#various1").fancybox({ 
       'titlePosition': 'inside', 
       'transitionIn': 'none', 
       'transitionOut': 'none' 
      }); 
     }); 
    </script> 

</head> 
<body> 
    <a id="various1" href="#inline1" ">Open CKEditor</a> 
    <div id="inline1"> 
     <textarea id="taCKEditor" name="taCKEditor" rows="2" cols="5">This is the sample text inside CKEditor</textarea> 
    </div> 
</body> 
</html> 
+0

一個鏈接將有助於看到問題 – JFK 2011-12-24 20:14:04

+0

@JFK,我已經包括與問題的示例。 – Prasad 2011-12-25 04:29:35

+0

有沒有人得到這個解決方案? CHROME仍然存在問題。 – Prasad 2012-05-17 05:12:45

回答

0

您需要創建形式和形式插入文本區域內。指定fancybox以形成id。在JavaScript觸發器中點擊表單。在加載之前使用fancybox回調,使用CKEditor加載器來檢查實例是否存在,如果不存在,它將刪除它。在beforeLoad從html塊加載到ckeditor內容。

相關問題