Re: [問題] ckdeitor

看板Ajax作者 (鞭策自己社清流夜靈)時間14年前 (2011/08/09 01:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
http://jsfiddle.net/nightspirit622/reSKd/9/ 我有用Jquery adaptor解法還蠻簡單的 點div或 textarea就會進editor mode 開的時候會加一個class給div表示打開 要關的話直接用selector找到各個打開的editor 用each()再 $(this).removeClass('ckeditormode').ckeditorGet().destroy(); ※ 引述《MacMini (被遺忘的)》之銘言: : 請問一下我該怎關閉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: 66.122.205.37 ※ 編輯: nightspirit 來自: 66.122.205.37 (08/09 04:17)
文章代碼(AID): #1EG1tKWV (Ajax)
討論串 (同標題文章)
本文引述了以下文章的的內容:
0
1
完整討論串 (本文為第 2 之 2 篇):
0
1
文章代碼(AID): #1EG1tKWV (Ajax)