2014-09-04 65 views
0

只是一個普遍的問題。根據API的jQuery對話框,Dosen'允許將主題包含在它的參數中。所以我猜測每個主題都必須像這樣宣佈。是否有可能擁有2個Dialog主題

<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" /> 
<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/cupertino/jquery-ui.css" rel="stylesheet" type="text/css" /> 

如何在模式對話框中使用第二個主題,因爲我無法看到從對話框中調用主題的方法。我在下面列出了示例代碼。所以我的問題是,如何在代碼中調用特定的主題。謝謝

$("#box_frtv").bind("chosen:maxselected", 
      function() { 
       //alert('Only 1 box can be selected. Thank you.'); 
          $("html").append("<div id='dialog-bferror' />"); 
          var $dialogBFError = $("#dialog-bferror"); 
          $dialogBFError.html('<br />Only 1 box can be selected . Thank you.'); 
          $dialogBFError.dialog({ 
           autoOpen: true, 
           modal: true, 
           title: 'File Error', 
           position: ['center', 'center'], 
           width: 400, 
           height: 200, 
           draggable: true, 
           resizable: false, 
           buttons: { 
            Close: function() { 
             $(this).dialog("close"); 
            } 
           } 
          }); 
     }); 
+0

只需編輯第二個CSS爲了使用樣式和類的對話框或重命名類。 – Hackerman 2014-09-04 19:04:11

+0

羅伯特你可以擴大你的答案請。謝謝 – user1532468 2014-09-04 19:11:27

回答

2

使用「diff」工具比較兩個CSS文件。然後創建一個包含其中一個文件中不同部分的本地CSS文件,並將應該使用這些樣式的對話的ID添加到所有這些部分。舉例來說,如果這條線是在第二個CSS文件的不同:

.ui-button .ui-button-text { display: block; line-height: 1.4; } 

把這個新的CSS文件:

#box_frtv .ui-button .ui-button-text { display: block; line-height: 1.4; } 

然後在適當位置從第二個主題的加載這個地方CSS文件淨。

+0

這就是我所說的... + 1 – Hackerman 2014-09-04 19:24:41

+0

非常感謝你 – user1532468 2014-09-04 19:27:57

+0

順便說一句'差異工具'是什麼? – user1532468 2014-09-04 19:28:30

相關問題