可以結合jquery ui 這個js來使用
<div id="reg" style="display: none"> 表單區域 </div>
<script> function IdInfo(Id) { $("#reg").dialog({ title : '被舉報題目信息', buttons : { '提交' : function () { }, '取消' : function () { $(this).dialog('close'); } }, position : 'center',//參數值可選的有('left top','top right','bottom left','right bottom','center') //設置寬高什么的不需要寫px,因為默認就是px /*width : 500, height : 500, minWidth : 150, minHeight : 150, maxWidth: 600, maxHeight : 600*/ //如果寫成false沒有什么特效,寫成true默認是淡入淡出 show : 'puff', //show : true hide : 'puff', //modal : true,//會有一層灰色的背景遮住不能操作頁面 closeText : '關閉',//提示性文字 }); } </script>