forked from aui/artDialog
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontent-element.html
More file actions
59 lines (50 loc) · 1.35 KB
/
Copy pathcontent-element.html
File metadata and controls
59 lines (50 loc) · 1.35 KB
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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<button id="test2">1. content(elem).show()</button> <button id="test3">2. close()</button> <button id="test4">3. show()</button> <button id="test5">4. close().remove()</button>
<div id="test-content" style="display:none"><p>我是隐藏的DOM节点<button id="test">alert</button></p></div>
<script src="../lib/sea.js"></script>
<script>
seajs.config({
alias: {
"jquery": "jquery-1.10.2.js"
}
});
</script>
<script>
seajs.use(['jquery', '../src/dialog'], function ($, dialog) {
window.dialog = dialog;
$('#test').on('click', function () {
alert('click')
});
var d = dialog({
title: '消息',
content: '风吹起的青色衣衫,夕阳里的温暖容颜,你比以前更加美丽,像盛开的花<br>——许巍《难忘的一天》',
okValue: '确 定'
});
var elem = document.getElementById('test-content');
$('#test2').on('click', function () {
d.content(elem).show();
});
$('#test3').on('click', function () {
d.close();
});
$('#test4').on('click', function () {
d.show();
});
$('#test5').on('click', function () {
d.close().remove();
});
d.addEventListener('remove', function () {
$('#test2, #test3, #test4, #test5').off('click').on('click', function () {
alert('对话框已经销毁');
});
});
});
</script>
</body>
</html>