2012-02-08 140 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