简体   繁体   English

jQuery UI 对话框移除外部发光并更改关闭按钮的文本

[英]jQuery UI dialog remove outer glow and change text of close button

I'm trying to customize my jQuery UI confirm dialog window.我正在尝试自定义我的 jQuery UI 确认对话框窗口。 Can't find how I can remove light blue outer glow from buttons (on hover), change close text button from "close" to "x" and remove close button hover background.找不到如何从按钮(悬停时)移除浅蓝色外发光,将关闭文本按钮从“关闭”更改为“x”并移除关闭按钮悬停背景。 Is there some documentation about all dialog classes somewhere?是否有一些关于所有对话框类的文档?

This is the code:这是代码:

function fnComfirm(title, content, btnId) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dialog-confirm p").text(content);
    $("#dialog-confirm").dialog({
        title: title,
        resizable: false,
        height: 200,
        width: 486,
        modal: true,
        buttons: {
            "OK": function() {
                $( this ).dialog("close");
                if (btnId) document.getElementById(btnId).click();                  
                return true;        
            },
            Cancel: function() {
                $( this ).dialog("close");
                return false;
            }
        }
    });
    $('body').css('overflow','hidden');
    $("div[role=dialog] button:contains('Cancel')").css("background-image", "none").css("border", "0px solid #FFF");
    $('.ui-dialog :button').blur();     
}

HTML: HTML:

<div id="dialog-confirm" title="Are you sure?"><p></p></div>

include:包括:

<h:outputScript library="js" name="jquery-ui-1.8.min.js" />

For changing the close button text, you can pass in an option like title (in the dialog creation), called closeText.要更改关闭按钮文本,您可以传入一个选项,如标题(在对话框创建中),称为 closeText。

$("#dialog-confirm").dialog({
    title: title,
    closeText : 'hello' //Changes the text of the titlebar-close button to hello instead of default Close
    ...
    ...
})

And to remove the outerglow(focus) from the close button, you can go into the css for the titlebar-close and mark outline property to be zero as follows:并且要从关闭按钮中删除外发光(焦点),您可以进入标题栏关闭的 css 并将轮廓属性标记为零,如下所示:

.ui-dialog .ui-dialog-titlebar-close {
   outline: 0;
 }
Div.dialog({ autoOpen: true, closeOnEscape: false, closeText: '', modal: true, draggable: false, resizable: false, width: 640, height: 420, close: function(event, ui) { if (orderModifyFlag == true) { messageDisplay(1000); } else { messageDisplay(651); } } });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM