如何让多个TinyMCE框架同时工作
我有 5 个页面使用tinyMCE,所有页面都在 iframe 中,但只有一个页面可以正常工作。
我该如何解决这个问题?
初始化代码是:
tinyMCE.init({
// General options
mode: "exact",
theme: "advanced",
elements: "txtBody",
dialog_type: "modal",
width: "500",
height: "400",
plugins: "autolink,lists,table,advhr,media,searchreplace,contextmenu,paste,directionality,noneditable,xhtmlxtras,template",
theme_advanced_buttons1: "styleselect,formatselect,fontselect,fontsizeselect,justifyleft,justifycenter,justifyright,justifyfull,",
theme_advanced_buttons2: "bold,italic,underline,strikethrough,cut,copy,paste,pastetext,pasteword,search,replace,insertfile,insertimage,",
theme_advanced_buttons3: "undo,redo,link,unlink,image,cleanup,code,forecolor,backcolortablecontrols,removeformat,sub,sup,media,advhr,ltr,rtl",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "right",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
skin: "o2k7",
skin_variant: "silver",
content_css: "../../App_Themes/Document.css"
});
i have 5 pages that use tinyMCE, all of them are in iframe but just one them works out.
how can i solve this problem ?
the init code is:
tinyMCE.init({
// General options
mode: "exact",
theme: "advanced",
elements: "txtBody",
dialog_type: "modal",
width: "500",
height: "400",
plugins: "autolink,lists,table,advhr,media,searchreplace,contextmenu,paste,directionality,noneditable,xhtmlxtras,template",
theme_advanced_buttons1: "styleselect,formatselect,fontselect,fontsizeselect,justifyleft,justifycenter,justifyright,justifyfull,",
theme_advanced_buttons2: "bold,italic,underline,strikethrough,cut,copy,paste,pastetext,pasteword,search,replace,insertfile,insertimage,",
theme_advanced_buttons3: "undo,redo,link,unlink,image,cleanup,code,forecolor,backcolortablecontrols,removeformat,sub,sup,media,advhr,ltr,rtl",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "right",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
skin: "o2k7",
skin_variant: "silver",
content_css: "../../App_Themes/Document.css"
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最合乎逻辑的解释是,您仅使用 elements 选项指定其中之一。但如果情况并非如此,请提供更多详细信息。
The most logical explanation is that you're only specifying one of them with your elements option. But please provide more detail if that's not the case.
第八,您需要指定所有 元素 (应将其打开的 html 元素的 ID到编辑器实例中)使用
mode: 'exact,'
时:或者使用
mode: "textareas",
并注意页面上正好有 5 个文本区域,并且和不同 ID。还有其他可能的设置。您可以查看有关模式设置的tinymce文档。
Eighter you need to specify all elements (ids of your html elments which should be turned into an editor instance) when using
mode: 'exact,'
:or you use
mode: "textareas",
and take care that there are exactly 5 textareas on your page and with different IDs.There are also other possible settings. You might check them out having a lokk at the tinymce documentation concerning the mode setting.
尝试在上面的代码中工具栏对齐是“右”而不是“左”
try above in your code toolbar alignment is 'right' instead of 'left'