我有以下代码使用jQuery UI进行确认对话:
function Help(section) {
$("#userpopup").remove();
$("body").append("<div id='userpopup' title='Help' style='display:none'></div>");
$('#userpopup').dialog({
autoOpen: true,
width: 560,
height: 500,
buttons: {
"OK": function () {
$(this).dialog("close");
$("#userpopup").remove();
}
},
open: function (event, ui) {
$("#userpopup").html("<iframe width='100%' height='400' src='?help§ion=" + section + "' frameborder='0' marginwidth='0' marginheight='0' allowtransparency='true'></iframe>");
},
beforeClose: function (event, ui) {
$("#userpopup").html("");
}
});
return false;
Run Code Online (Sandbox Code Playgroud)
}
<input onClick="javascript:Help('templates')" type="button" class="btn" value="help">
Run Code Online (Sandbox Code Playgroud)
如何更改它以使用Bootstrap Modals?
dialog jquery-ui modal-dialog twitter-bootstrap bootstrap-modal