我有一个页面,我一起使用手风琴和tinymce。不能在一个页面上显示多个tinymce编辑器
对于accordion控件中的每个展开/折叠组合,我都有一个编辑按钮。点击编辑按钮显示一个有2个输入的表单。第一个是文本框,第二个是textarea。
我希望textarea是一个tinymce实例。手风琴控件有多个展开/折叠控件,我想为它们中的每一个出现一个tinymce实例。
我的TinyMCE的初始化代码如下所示
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,|,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,paste,pastetext,pasteword,|,bullist,numlist,|,advhr,|,forecolor,formatselect",
// theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "", //"cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "", //"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "", //"insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
});
当我在Chrome和Firefox加载的页面,出现预期的手风琴控制。但是,tinymce控件仅出现在第一个折叠div中。折叠div的其余部分显示常规textareas而不是tinymce编辑器。
我还没有在IE上测试过。
有人可以帮忙。我不确定我做错了什么。
在此先感谢 普尼特
你怎么TinyMCE的绑定到你的文字区域? – Hck 2012-02-29 07:20:21
我是否必须将每个textarea单独绑定到tinymce? – ppaul74 2012-02-29 07:27:47
不,您可以使用类选择器一次绑定所有textareas。但要弄清楚这个问题,我需要知道你如何将tinuMce实例绑定到你的textarea上。 – Hck 2012-02-29 07:56:19