【问题标题】:Change the gray color of the dialog更改对话框的灰色
【发布时间】:2014-06-07 15:08:55
【问题描述】:

我正在使用以下对话框,我想将按钮和标题的灰色更改为蓝色, 我该怎么做?

这是代码

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

【问题讨论】:

标签: javascript jquery html css


【解决方案1】:

JqueryUI 具有 ThemeRoller,可让您为其外观设置样式。您也可以手动执行,但您应该先检查一下:

http://jqueryui.com/themeroller/

【讨论】:

    【解决方案2】:

    这将为您的按钮设置样式。

      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;}
    

    【讨论】:

    • 嗨阿里,我使用你为 JS 提供的代码时,我得到错误匿名函数被用作声明,知道如何克服它吗?
    • 感谢阿里投票!,这正是我需要的按钮,标题中的灰线呢,是否也可以更改它?
    • 嗨 Ali,我在谈论 .ui-dialog-titlebar,我应该如何将它添加到您的 CSS 中?当我将它添加到您提供的 CSS 中时,它不起作用...
    • 嘿@JohnJerrby,看看我的编辑,如果我帮助了你,+1 并标记为解决。
    • 那行 CSS 允许您更改标题栏颜色。我测试了它:)
    【解决方案3】:

    这里是代码 - $div.dialog({ 模态:真, 最大高度:500, }).prev(".ui-dialog-titlebar").css("background","blue");

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-24
      • 1970-01-01
      • 2013-06-07
      • 2013-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多