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 the title bar is hidden but the space taken by the bar is still there. I want to remove that space also but without removing the close button.
How can i do this?
Based on this answer:
Use
.dialog("widget")option to locate the div wrapper for the dialog. The wrapper contains all the markup used for the dialog including header, title bar and close button; and the dialog content itself. Here is one way to invoke the method and hide the title bar:You can then use CSS to eliminate unnecessary margin, border and padding. For example:
Here is a demo based on above code plus it adds the necessary styles using jQuery.