-
Notifications
You must be signed in to change notification settings - Fork 2
/
DragDialog.htm
62 lines (48 loc) · 1.8 KB
/
DragDialog.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>DragDialog</title>
<script type="text/javascript" src="jWebForm.js"></script>
<script type="text/javascript" src="DragObj.js"></script>
<script type="text/javascript">
$j.Page_Load = function Page_Load() {
var div1 = document.getElementById("div1");
var drag1 = $j.DragObj(div1);
drag1.Width("400px");
drag1.Height("300px");
drag1.MinWidth("400px");
drag1.MinHeight("300px");
var divContent = document.getElementById("divContent");
drag1.NotDrag(divContent); // NotDrag() 方法用于设置元素不受拖拉影响
var spanClose = document.getElementById("spanClose");
spanClose.addEventListener("click", function () {
drag1.Close();
});
drag1.Show();
}
</script>
</head>
<body>
<div style="font-size:60px">
拖拖看<br />
可将鼠标放在对话框边缘调整对话框大小
</div>
<div id="div1" style="border: 1px solid gray; height: 100%; background-color:white ">
<table id="table1" style="width:100%; height:100%">
<tr>
<td style="height:1px">
<div>标题<span id="spanClose" style="float:right">×</span></div>
</td>
</tr>
<tr>
<td style="padding-bottom:10px">
<div id="divContent" style="height: 100%; border-top: solid 1px gray; border-bottom: solid 1px gray">
<br />这是正文
</div>
</td>
</tr>
</table>
</div>
</body>
</html>