Re: [問題] ckdeitor
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)
討論串 (同標題文章)
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章