2012-02-08 1648 views
2

我正在使用tinyMCE编辑器插件。它将texareas转换为iframe,并在文本内容的顶部显示一个工具栏。它工作完美。如何在tinyMCE工具栏上设置z-index?

有时在内容上方有一些视频。所以当我点击textarea时,会出现工具栏,但是内容上方的视频播放器会隐藏它自身。

有什么方法可以改变工具栏的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" 
    }); 
+0

删除PHP标签 – phpmeh 2012-02-08 13:35:01

回答

2

您也可以使用初始化设置PARAM

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

是的。它使用'$(“。mceExternalToolbar”).css('z-index','1000');' – Awan 2012-02-08 14:27:36

2

TinyMCE的是调换了textarea的,所以就把textarea的放入容器中,并设置z-index的容器上。

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

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

本页面要求加入“不透明”到“wmdode”玩家的参数是一个解决方案,但我没有测试它: http://slightlymore.co.uk/flash-and-the-z-index-problem-solved/

+1

之后除非你设置的wmode透明设置的z-index。 – 2012-02-08 13:29:45

+1

@BarryChapman Ha - jinx =] – 2012-02-08 13:31:31

1

你发现你已经添加了两个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" 
    }); 
+0

这是一个错字。 – Awan 2012-02-08 13:45:21