我希望能够将 x 放在对话框的右上角而不是关闭文本。另外,我喜欢不能拖动这个对话框,你能帮忙在jquery中如何做这两件事吗?
<script type="text/javascript">
jQuery(document).ready( function(){
jQuery("#lin").click( showDialog );
//variable to reference window
$myWindow = jQuery('#myDiv');
//instantiate the dialog
$myWindow.dialog({ height: 600,
width: 700,
modal: true,
draggable: true,
position: 'center',
autoOpen:false,
title:'Hello World',
overlay: { opacity: 0.5, background: 'black'}
});
}
);
//function to show dialog
var showDialog = function() {
//if the contents have been hidden with css, you need this
$myWindow.show();
//open the dialog
$myWindow.dialog("open");
}
//function to close dialog, probably called by a button in the dialog
var closeDialog = function() {
$myWindow.dialog("close");
}
</script>
</head>
<body>
<div id="myDiv">
<p>this is a test</p>
</div>