-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
192 lines (179 loc) · 6.12 KB
/
index.html
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>dialog 是一个豆瓣风格的 jQuery 对话框,旨在提供一个轻量、简洁的原生对话框替换工具</title>
<meta name="description" content="dialog 是一个豆瓣风格的 jQuery 对话框,旨在提供一个轻量、简洁的原生对话框替换工具。" />
<meta name="keywords" content="jquery,dialog,javascript,micate,对话框,豆瓣" />
<link rel="stylesheet" type="text/css" href="css/dialog.css" />
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
background: #FFF;
font: 12px/162% Arial,Helvetica,sans-serif;
}
p {
margin: 0 0 10px;
}
img {
border: 0;
}
.doc {
width: 650px;
margin: 100px auto 50px;
}
.mod-code pre {
margin: 15px 0;
padding: 5px 5px 5px 10px;
border-left: 5px solid #CCC;
word-wrap: break-word;
white-space: pre-wrap;
}
.mod-banner {
position: fixed;
z-index: 99998;
_position: absolute;
width: 100%;
height: 55px;
padding-top: 20px;
left: 0;
top: 0;
text-align: center;
background: #333;
color: #FFF;
}
.mod-banner p {
margin-top: 5px;
}
.doc h2 {
margin-top: 25px;
}
#fork {
position: fixed;
_position: absolute;
right: 0;
top: 0;
z-index: 99999;
}
</style>
</head>
<body>
<div class="doc">
<div class="mod-banner">
<h1>dialog</h1>
<p>dialog 是一个豆瓣风格的 jQuery 对话框,旨在提供一个轻量、简洁的原生对话框替换工具。</p>
</div>
<h2>演示 Demo</h2>
<div class="mod-demo">
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
<a href="javascript:;" onclick="dialog.ok('dialog.ok();');">dialog.ok();</a>
</div>
<h2>载入 Init</h2>
<div class="mod-code">
<pre>
<link rel="stylesheet" type="text/css" href="css/dialog.css" />
<script src="js/jquery.js"></script>
<script src="js/dialog.js"></script>
</pre>
</div>
<h2>配置 Config</h2>
<div class="mod-code">
<pre>
</pre>
</div>
<h2>用法 Usage</h2>
<div class="mod-code">
<pre>
$(function() {
//dialog.setup({width:600/*, height:400*/});
dialog.setup({overlay:false/*, minWidth:500*/});
/*dialog.ok({title:'新提示', message:'hello, worldddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />hello, world<br />'}, function() {
dialog.tips('callback');
});*/
/*dialog.confirm('确定要刷新页面吗?', function() {
dialog.tips('Yes Clicked!');
}, function() {
dialog.error('No Clicked!');
});*/
// submit, load, error, beforeSubmit, beforeSerialize, close
/*dialog.form('form demo', 'demo/html/form.php', function(json) {
dialog.tips('form submit');
//console.info(json);
}, function() {
dialog.tips('form load');
}, function() {
dialog.error('form error');
}, function() {
dialog.tips('form beforeSubmit');
}, function(beforeSerialize) {
dialog.tips('form beforeSerialize');
}, function() {
dialog.tips('form close');
});*/
dialog.button({
title: '添加成功',
message: '<a href="http://www.baidu.com/" target="_blank">http://www.baidu.com/</a>'
}, [{
text: '确定',
callback: function() {
dialog.tips('hello, world');
return false; // prevent close button dialog(default is close)
}
}, {
text: '取消',
callback: function() {
dialog.tips('Orz...');
}
}]);
//dialog.show('<img src="http://cn.bing.com/fd/hpk2/TheEx_ZH-CN1218152540.jpg" width="500" />');
dialog.show({
title: '测试',
url: 'demo/html/iframe.html',
width:400,
height:300
}, undefined, undefined, function() {
dialog.ok('iframe.html close');
});
dialog.show({
title: '百度',
url: 'http://www.baidu.com',
width:800,
height:500
});
});
</pre>
</div>
<h2>下载 Download</h2>
<p><br /><a href="https://github.com/micate/dialog">代码托管在 Github 上</a>,<a href="https://github.com/micate/dialog/zipball/master">直接下载</a>。如遇到问题欢迎 <a href="https://github.com/micate/dialog/issues">提交 issue</a>。</p>
</div>
<a id="fork" href="https://github.com/micate/dialog">
<img src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub">
</a>
<script src="js/jquery.js"></script>
<script src="js/dialog.js"></script>
<!-- /* analytics code begin -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ffb8afea1e70c3ca0813914e87535eab8' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-7715988-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- analytics code */ -->
</body>
</html>