2014-06-06 42 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”);