2014-06-06 38 views
0

使用下面的對話框,我想將按鈕和標題的灰色顏色更改爲藍色, 我應該怎麼做?更改對話框的灰色

這是代碼

$dialog.dialog({ 
      autoOpen: false, 
      modal: true,  
      show: {effect: 'fade', duration: 2000}, 
      buttons: {  

enter image description here

+0

http://stackoverflow.com/questions/12511609/customize-the-style-for-specific-jquery-ui-dialog-box-not-all-the-dialogs – Andrew

+0

@ Andrew-Ive已經試過$( 「#dialog」)。parent()。find(「。ui-dialog-titlebar-close」)。css(「background」,「#1C1C1C」);這是不工作的頭... –

回答

1

這將樣式化的按鈕。

open: function (e, ui) { 
     $(this).parent().find(".ui-dialog-buttonpane .ui-button") 
      .addClass("orange"); 
    } 
}); 

CSS

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset .orange { 
    /* put styling here */ 
} 

對於標題欄:

.ui-dialog > .ui-widget-header {background: red;} 
+0

嗨阿里,我使用你提供的JS代碼我得到錯誤匿名函數用作聲明,任何想法如何克服它? –

+0

試試這個:http://jsfiddle.net/BjN98/ –

+0

謝謝阿里投票了!,這正是我需要的按鈕,那麼標題中的灰線怎麼樣,是否有可能改變它呢? –

2

jQueryUI的具有的ThemeRoller,它可以讓你的風格它的外形。您也可以手動做到這一點,但你應該先檢查一下:

1

這裏是代碼 - $ div.dialog({ 模式:真, maxHeight:500, (「。ui-dialog-titlebar」)。css(「background」,「blue」);