0

jQueryUIの確認ダイアログウィンドウをカスタマイズしようとしています。ボタンから水色の外側の輝きを削除する方法(ホバー中)が見つかりません。テキストを閉じるボタンを「閉じる」から「x」に変更し、ボタンを閉じるホバーの背景を削除します。すべてのダイアログクラスに関するドキュメントはどこかにありますか?

これはコードです:

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:

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

含む:

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

2 に答える 2

6

閉じるボタンのテキストを変更するには、(ダイアログの作成時に) タイトルなどのオプションを渡すことができます。これは closeText と呼ばれます。

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

また、閉じるボタンからアウターグロー (フォーカス) を削除するには、次のように titlebar-close の css に移動し、outline プロパティを 0 にマークします。

.ui-dialog .ui-dialog-titlebar-close {
   outline: 0;
 }
于 2016-01-08T15:29:27.037 に答える