[問題] ckdeitor

看板Ajax作者 (被遺忘的)時間14年前 (2011/08/06 13:14), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/2 (看更多)
請問一下我該怎關閉ckeditor 我用 jQuery 程式是這樣寫的 $(function(){ $('span').click(function(){ CKEDITOR.replace($(this).parent().find('textarea').attr('name')) }) }) 我用這個方式啟動他 那 我要怎麼讓他回復到沒有編集器的狀態之下呢 解法 var config = {width:'600'}; var html , editor = new Array(); $(function(){ window.CKEDITOR_BASEPATH='javascript/ckeditor/'; $('div span').click(function(){ var id = $(this).parent().find('textarea').attr('name'); if(editor[id] != null){ $(this).html('文字編輯器(關)'); editor[id].destroy(); editor[id] = null; }else{ editor[id] = CKEDITOR.replace(id,config); $(this).html('文字編輯器(開)'); } }) }) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.32.228.158

08/06 13:33, , 1F
我記得他有自己的api可以回textarea 你翻一下官方文件吧
08/06 13:33, 1F
※ 編輯: MacMini 來自: 114.32.228.158 (08/06 13:54) ※ 編輯: MacMini 來自: 114.32.228.158 (08/06 14:00)
文章代碼(AID): #1EFCsPxe (Ajax)
討論串 (同標題文章)
以下文章回應了本文
完整討論串 (本文為第 1 之 2 篇):
0
1
文章代碼(AID): #1EFCsPxe (Ajax)