作者nightspirit (鞭策自己社清流夜灵)
看板Ajax
标题Re: [问题] ckdeitor
时间Tue Aug 9 01:33:05 2011
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)