jquery UI 對話框設定

使用對話框增進使用者體驗


1.下載檔案

https://jqueryui.com/download

然後把js檔 css檔跟images複製到專案下
2.引用css跟js檔
<link href="../_css/jquery-ui.min.css" rel="stylesheet">
<script src="../_js/jquery-ui.min.js"></script>
3.
選取元素 然後$().dialog()
裡面可以用物件實字放屬性
4.屬性
draggable
resizeable
height
width
minWidth
minHeight
maxWidth
maxHeight
modal:鎖住對話框
show.hide:可以放true flase 或數字  出現或隱藏的速度 也可以傳slideDown slideUp
position :放陣列 [x,y] 或關鍵字center left top right bottom
autoOpen:true false 對話框要不要立即顯示
buttons:要放的按鈕
例如:buttons :{
"Confirm":function(){
},
"Cancel":function(){

}

}

如果對話框裡面有個表單,提交時要關掉
$('#login form').submit(function(){
$('').dialog('close');
})