I want to remove dialog header in jQuery UI and add my close button. Close button is image, when user click image, dialog'll be closed. This my snippet:
$("#dialog-model").dialog({
create: function (event, ui) {
jQuery(".ui-dialog-titlebar").hide();
$("#dialog-model").css({ 'font-family': 'Helvetica', 'padding': '0', 'font-size': '12px' });
},
height: 500,
width: 900,
modal: true,
});
I try to add image in scipt but it doesn't work
Try this one? DEMO http://jsfiddle.net/yeyene/GnpQ8/2/
Create a custom close button.
$(document).ready(function(){
$("#dialog-model").dialog({
create: function (event, ui) {
$('.ui-dialog-titlebar').css({'background':'none','border':'none'});
$(".ui-dialog-titlebar").html('<a href="#" role="button"><span class="myCloseIcon">close</span></a>');
$("#dialog-model").css({ 'font-family': 'Helvetica', 'padding': '0', 'font-size': '12px' });
},
width: 250,
height: 150,
modal: true,
resizable: false
});
$("span.myCloseIcon").click(function() {
$( "#dialog-model" ).dialog( "close" );
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With