1.引入文件
jquery.x.x.x.js文件
jquery-ui-x.x.x.custom.js文件
jquery-ui-x.x.x.custom.min.css文件
例子:
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.3.custom.min.js"></script>
<link rel="stylesheet" href="css/jquery-ui-1.10.3.custom.min.css">
2.写弹出层的div
例子:
<!--弹出层的div-->
<div id="d1" title="我的自定义的弹出层">
<form action="aaa.action" method="get" id="form1">
<br>
姓名:
<input name="name" type="text">
<br>
密码:
<input type="password" name="pwd">
<br>
</form>
</div>
例子:
<script>
$(function(){
$('#d1').dialog({
autoOpen: true,
height: 300,
width: 350,
modal: true,
buttons: {
"确定": function() {
//$('form1').submit();
},
"取消": function() {
$( this ).dialog( "close" );
}
},
//close: function() {alert('close');}
});
});
function f11(){
$('#d1').dialog( "open" );
}
</script>