First, if you add an icon to the title, I would suggest applying the class to this dialog box and styling it with CSS. Example:
$( "#some_div" ).dialog({ dialogClass: "someClass" });
If you still want to add a custom method, here is what the documentation says:
Set a callback function to handle the create event as an init parameter.
$( ".selector" ).dialog({ create: function(event, ui) { ... } });
Binding to a creation event by type: dialogcreate.
$( ".selector" ).bind( "dialogcreate", function(event, ui) { ... });
source share