How to remove jQuery-ui dialog title bar?

前端 未结 4 1260
闹比i
闹比i 2021-02-02 14:54

I am trying to hide jQuery-ui dialog\'s title bar but keep the close button in the title bar visible. I have searched lots of post on stackoverflow like this one. In each post t

4条回答
  •  旧时难觅i
    2021-02-02 14:59

    If you want to remove the titelbar and keep the close icon using styles only, use the styles below. It shrinks the title bar to the size of the close icon and hides it behind. ui-icons_6e6e6e_256x240.png i created by lightening the ui-icons_222222_256x240.png image that jqueryui comes with.

    .ui-dialog .ui-dialog-titlebar.ui-widget-header{background: none; border: none; height: 20px; width: 20px; padding: 0px; position: static; float: right; margin: 0px 2px 0px 0px;}
    
    .ui-dialog-titlebar.ui-widget-header .ui-dialog-title{display: none;}
    
    .ui-dialog-titlebar.ui-widget-header .ui-button{background: none; border: 1px solid #CCCCCC;}
    
    .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close{margin: 0px; position: static;}
    
    .ui-dialog .dialog.ui-dialog-content{padding: 0px 10px 10px 10px;}
    
    .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close .ui-icon{position: relative; margin-top: 0px; margin-left: 0px; top: 0px; left: 0px;}
    
    .ui-dialog .ui-dialog-titlebar .ui-state-default .ui-icon {background-image: url("/css/ui-lightness/images/ui-icons_6e6e6e_256x240.png");}
    
    .ui-dialog .ui-dialog-titlebar .ui-state-hover .ui-icon {background-image: url("/css/ui-lightness/images/ui-icons_222222_256x240.png");}
    

提交回复
热议问题