如何在tinyMCE工具栏上设置z-index?

发布于 2025-01-03 23:56:57 字数 523 浏览 2 评论 0原文

我正在使用tinyMCE编辑器插件。它将 texarea 转换为 iframe,并且工具栏出现在文本内容的顶部。它工作得很好。

有时内容上方会有一些视频。因此,当我单击文本区域时,工具栏会出现,但内容上方的视频播放器会将其隐藏在自身后面。

有什么办法可以改变工具栏的 z-index 吗? (优选) 或者我应该更改工具栏的位置???

这是我的代码:

tinyMCE.init({
        mode : "textareas",
        editor_selector : "combo123",
        theme : "advanced",
        plugins : "save, paste, autoresize, asciimath, asciisvg",
        theme_advanced_styles: "Foo=foo, Bar=bar",
        content_css : "/css/tiny_mce.css"
  });

I am using tinyMCE editor plugin. It converts texareas into iframes and a toolbar appears at top of the text content. It is working perfectly.

Sometimes there are some videos above the content. So when I click textarea, the toolbar appears but video player above the content hides it behind itself.

Is there any way to change the z-index of the toolbar ? (Preferable)
Or should I change the location of toolbar ???

Here is my code:

tinyMCE.init({
        mode : "textareas",
        editor_selector : "combo123",
        theme : "advanced",
        plugins : "save, paste, autoresize, asciimath, asciisvg",
        theme_advanced_styles: "Foo=foo, Bar=bar",
        content_css : "/css/tiny_mce.css"
  });

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(8

天煞孤星 2025-01-10 23:56:57

增加tinymce的z-index,这样它就不会被另一个div覆盖

<style>
    .tox-tinymce-aux{z-index:99999999999 !important;}
</style>

Increase the z-index for tinymce so it does not get overridden from another div

<style>
    .tox-tinymce-aux{z-index:99999999999 !important;}
</style>
木格 2025-01-10 23:56:57

您还可以在初始化后使用设置参数设置 z-index

setup : function(ed) {
    ed.onInit.add(function(ed){
        $('tr.mceFirst').css('z-index','1');
    });
}),

You may also set the z-index right after initialization using the setup param

setup : function(ed) {
    ed.onInit.add(function(ed){
        $('tr.mceFirst').css('z-index','1');
    });
}),
北笙凉宸 2025-01-10 23:56:57

tinyMCE 正在对文本区域进行转置,因此将文本区域放入容器中并在容器上设置 z-index。

<div style="z-index: 10;"><textarea></textarea></div>

The tinyMCE is transposing over the textarea, so put the textarea into a container and set the z-index on the container.

<div style="z-index: 10;"><textarea></textarea></div>
神魇的王 2025-01-10 23:56:57

如果视频播放器是基于 Flash 的,这将无济于事。

此页面声称将“opaque”添加到播放器的“wmdode”参数是一个解决方案,但我还没有测试过:
http://slightlymore.co.uk/flash-and- -z-index-问题已解决/

If the video player is Flash based, this won't help.

This page claims adding "opaque" to the "wmdode" param of the player is a solution, but I haven't tested it:
http://slightlymore.co.uk/flash-and-the-z-index-problem-solved/

清眉祭 2025-01-10 23:56:57

注意你添加了两个content_css,它应该只是一个content_css

实际上content_css应该让你的网站.css添加目的,,所以对于textarea你可以在你的css中限制,你可以设置宽度和高度

tinyMCE.init({
        mode : "textareas",
        editor_selector : "combo123",
        theme : "advanced",
        plugins : "save, paste, autoresize, asciimath, asciisvg",

        theme_advanced_styles: "Foo=foo, Bar=bar",

        content_css : "/css/yoursite.css"
  });

to your Notice you have added two content_css, it should be only one content_css

actually the content_css should have your site .css adding purpose ,,so for textarea you can restrict in your css and you can set the width and height

tinyMCE.init({
        mode : "textareas",
        editor_selector : "combo123",
        theme : "advanced",
        plugins : "save, paste, autoresize, asciimath, asciisvg",

        theme_advanced_styles: "Foo=foo, Bar=bar",

        content_css : "/css/yoursite.css"
  });
肥爪爪 2025-01-10 23:56:57

我用这个解决了

$(document).on('focusin', function (e) {
   if ($(e.target).closest(".mce-window").length) 
      e.stopImmediatePropagation();
});

I solved using this

$(document).on('focusin', function (e) {
   if ($(e.target).closest(".mce-window").length) 
      e.stopImmediatePropagation();
});
晨曦÷微暖 2025-01-10 23:56:57

这适用于角度,将其添加到您的 component.scss

::ng-deep .tox-tinymce-inline {
  z-index: 200 !important;
}

this works in angular, add it to your component.scss

::ng-deep .tox-tinymce-inline {
  z-index: 200 !important;
}
久而酒知 2025-01-10 23:56:57

tinymce.ui.FloatPanel.zIndex = 99;

tinymce.ui.FloatPanel.zIndex = 99;

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