我有一個頁面,我一起使用手風琴和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