jquery UI dialog: how to initialize without a title bar?

前端 未结 23 1773
春和景丽
春和景丽 2020-11-29 15:03

Is it possible to open a jQuery UI Dialog without a title bar?

23条回答
  •  情话喂你
    2020-11-29 16:03

    You could remove the bar with the close icon with the techinques described above and then add a close icon yourself.

    CSS:

    .CloseButton {
    background: url('../icons/close-button.png');   
    width:15px;
    height:15px;
    border: 0px solid white;
    top:0;
    right:0;
    position:absolute;
    cursor: pointer;
    z-index:999;
    }
    

    HTML:

    var closeDiv = document.createElement("div");
    closeDiv.className = "CloseButton";
    

    //append this div to the div holding your content

    JS:

     $(closeDiv).click(function () {
             $("yourDialogContent").dialog('close');
         });
    

提交回复
热议问题