2012-02-09 47 views
0

我嘗試創建一個WordPress在TinyMCE插件,會爲了顯示彈出的對話框使用ThickBox的。調整大小的ThickBox

現在,我想知道如果有調整ThickBox的方式,根據屏幕大小,而不是基於對寬度和高度,我可以在插件開發給靜態值。

有什麼想法嗎?

+0

問題是這個網站不是話題的問題,因爲他們不直接涉及的WordPress。遷移到堆棧溢出,您可能會得到一些更好的建議。 – EAMann 2012-02-09 14:25:43

回答

0

OK,我找到了解決方案,我在這裏把它用於其他成員的未來使用。

我插下面的代碼TinyMCE的插件代碼:上ThickBox的和TinyMCE的

ed.addCommand(
    'openPluginDialog', 
    function() 
    { 
     var w = window.innerWidth;  // Get the inner window width 
     var h = window.innerHeight;  // Get the inner window height 

     w = (w * 90)/100;    // Calculate the dialog width 
     h = (h * 85)/100;    // Calculate the dialog height 

     ed.windowManager.open(
      { 
       file : url + '/plugin_dialog.html', 
       width : w,    // The calculated window width 
       height : h,    // The calculated window height 
       inline : 1, 
       title: 'Plugin dialog title' 
      }, 
      { 
       plugin_url : url 
      } 
     ); 
    } 
);