如何让多个TinyMCE框架同时工作

发布于 2024-11-06 03:32:31 字数 1176 浏览 4 评论 0原文

我有 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 ?

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冰雪梦之恋 2024-11-13 03:32:31

最合乎逻辑的解释是,您仅使用 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.

迷离° 2024-11-13 03:32:31

第八,您需要指定所有 元素 (应将其打开的 html 元素的 ID到编辑器实例中)使用 mode: 'exact,' 时:

elements: 'my_html_element_id1,my_html_element_id2,my_html_element_id3,my_html_element_id,my_html_element_id5',

或者使用 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,':

elements: 'my_html_element_id1,my_html_element_id2,my_html_element_id3,my_html_element_id,my_html_element_id5',

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.

淡写薰衣草的香 2024-11-13 03:32:31
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : true,
theme_advanced_resizing_min_height : 100,

尝试在上面的代码中工具栏对齐是“右”而不是“左”

theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : true,
theme_advanced_resizing_min_height : 100,

try above in your code toolbar alignment is 'right' instead of 'left'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文