-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
534 lines (476 loc) · 22.6 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="telephone=no,email=no" name="format-detection">
<meta name="author" content="haibao"/>
<meta name="url" content="http://www.hehaibao.com/"/>
<link rel="stylesheet" href="css/animate.min.css"/> <!-- 动画效果 -->
<link rel="stylesheet" href="css/common.css"/><!-- 页面基本样式 -->
<title>jQuery+CSS3 多功能弹出层插件(v2.0.3) - by haibao</title>
</head>
<body>
<a href="https://github.com/hehaibao/hDialog">
<img style="position: fixed; top: 0; right: 0; border: 0; z-index: 2000;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png">
</a>
<div id="wrapper">
<header><h2>jQuery+CSS3 多功能弹出层插件<sup>v2.0.3</sup> - <small><a target="_blank" href="http://www.hehaibao.com/jquery-css3-plugin/">@haibao</a></small></h2></header>
<div class="box">
<div class="demo">
<div class="w50">
<h3>打开效果示例(需引入<a target="_blank" href="http://daneden.github.io/animate.css/animate.min.css">animate.css</a>):</h3>
<div class="example">
<a data-type="bounceIn" class="dialog">bounceIn</a>
<a data-type="bounceInDown" class="dialog">bounceInDown</a>
<a data-type="bounceInLeft" class="dialog">bounceInLeft</a>
<a data-type="bounceInRight" class="dialog">bounceInRight</a>
<a data-type="bounceInUp" class="dialog">bounceInUp</a>
<a data-type="rollIn" class="dialog">rollIn</a>
<a data-type="fadeIn" class="dialog">fadeIn</a>
<a data-type="fadeInUpBig" class="dialog">fadeInUpBig</a>
<a data-type="lightSpeedIn" class="dialog">lightSpeedIn</a>
<a data-type="flip" class="dialog">flip</a>
<a data-type="flipInX" class="dialog">flipInX</a>
<a data-type="flipInY" class="dialog">flipInY</a>
<a data-type="rotateInDownLeft" class="dialog">rotateInDownLeft</a>
<a data-type="rotateInDownRight" class="dialog">rotateInDownRight</a>
<a data-type="rotateInUpLeft" class="dialog">rotateInUpLeft</a>
<a data-type="rotateInUpRight" class="dialog">rotateInUpRight</a>
<a data-type="rubberBand" class="dialog">rubberBand</a>
<a data-type="zoomIn" class="dialog">zoomIn</a>
<a data-type="zoomInDown" class="dialog">zoomInDown</a>
<a data-type="zoomInLeft" class="dialog">zoomInLeft</a>
<a data-type="zoomInRight" class="dialog">zoomInRight</a>
<a data-type="zoomInUp" class="dialog">zoomInUp</a>
<a data-type="flash" class="dialog">flash</a>
<a data-type="pulse" class="dialog">pulse</a>
<a data-type="swing" class="dialog">swing</a>
<a data-type="tada" class="dialog">tada</a>
<a data-type="jello" class="dialog">jello</a>
<a data-type="shake" class="dialog">shake</a>
<a data-type="wobble" class="dialog">wobble</a>
<a data-type="slideInUp" class="dialog">slideInUp</a>
<a data-type="slideInLeft" class="dialog">slideInLeft</a>
<a data-type="slideInRight" class="dialog">slideInRight</a>
<a data-type="slideInDown" class="dialog">slideInDown</a>
</div>
</div>
<div class="w50">
<h3>关闭效果示例(需引入<a target="_blank" href="http://daneden.github.io/animate.css/animate.min.css">animate.css</a>):</h3>
<div class="example">
<a class="demo16">fadeOut</a>
<a class="demo25">fadeOutDown</a>
<a class="demo26">fadeOutLeft</a>
<a class="demo27">fadeOutRight</a>
<a class="demo28">fadeOutUp</a>
<a class="demo20">bounceOut</a>
<a class="demo21">bounceOutDown</a>
<a class="demo22">bounceOutleft</a>
<a class="demo23">bounceOutRight</a>
<a class="demo24">bounceOutUp</a>
<a class="demo29">flipOutX</a>
<a class="demo30">flipOutY</a>
<a class="demo31">lightSpeedOut</a>
<a class="demo32">rotateOut</a>
<a class="demo33">rotateOutDownLeft</a>
<a class="demo34">rotateOutDownRight</a>
<a class="demo35">rotateOutUpLeft</a>
<a class="demo36">rotateOutUpRight</a>
<a class="demo37">slideOutUp</a>
<a class="demo38">slideOutDown</a>
<a class="demo39">slideOutLeft</a>
<a class="demo40">slideOutRight</a>
<a class="demo41">zoomOut</a>
<a class="demo42">zoomOutDown</a>
<a class="demo43">zoomOutLeft</a>
<a class="demo44">zoomOutRight</a>
<a class="demo45">zoomOutUp</a>
<a class="demo46">rollOut</a>
</div>
</div>
<div class="w50">
<h3>其他效果示例:</h3>
<div class="example">
<a class="demo0 wobble">带标题的</a>
<a class="demo1">改变宽度</a>
<a class="demo2">改变高度</a>
<a class="demo3">改变宽和高</a>
<a class="demo4 bounceInUp">改变位置</a>
<a class="demo14">显示前回调</a>
<a class="demo15">隐藏后回调</a>
<a class="demo6">遮罩不可点击关闭</a>
<a class="demo7">改变弹框背景色</a>
<a class="demo8">改变遮罩背景色</a>
<a class="demo19">不显示遮罩</a>
<a class="demo17 rubberBand">定时关闭</a>
<a class="demo50">iframe框架</a>
</div>
</div>
<div class="w50">
<h3>内置扩展方法示例:</h3>
<div class="example">
<a class="demo10">错误提示</a>
<a class="demo11">正确提示</a>
<a class="demo47">提示后回调</a>
<a class="demo12">显示加载</a>
<a class="demo48">confirm</a>
<a class="demo49">alert</a>
</div>
</div>
<div class="desc">
<h3>使用说明:</h3>
<pre>
/*
* 以下是单独的调用示例,你只需要自定义弹框的样式即可。
* - $(element).hDialog(); //默认调用弹框;
* - $(element).hDialog({box: '#demo'}); //自定义弹框容器ID/Class;
* - $(element).hDialog({boxBg: '#eeeeee'}); //自定义弹框容器背景;
* - $(element).hDialog({modalBg: '#eeeeee'}); //自定义遮罩背景颜色;
* - $(element).hDialog({width: 500}); //自定义弹框宽度;
* - $(element).hDialog({height: 400}); //自定义弹框高度;
* - $(element).hDialog({position: 'top'}); //弹框位置(默认center:居中,top:顶部居中,left:顶部居左,bottom:底部居右)
* - $(element).hDialog({effect: 'fadeOut'}); //弹框关闭效果(结合animate.css里的动画,默认:zoomOut);
* - $(element).hDialog({hideTime: 2000}); //弹框定时关闭(默认0:不自动关闭, 以毫秒为单位)
* - $(element).hDialog({modalHide: false}); //false:点击遮罩背景不关闭弹框,反之关闭;
* - $(element).hDialog({isOverlay: false}); //是否显示遮罩背景(默认true:显示,false:不显示)
* - $(element).hDialog({escHide: false}); //false:按ESC不关闭弹框,反之关闭;
* - $(element).hDialog({autoShow: false}); //是否页面加载完成后自动弹出(默认false点击弹出,true:自动弹出)
* - $(element).hDialog({autoHide: true}); //是否页面加载完成后自动关闭弹出(默认false: 不关闭,true: 关闭)
* - $(element).hDialog({types:2,iframeSrc:'http://css.doyoe.com/',iframeId:'iframeHBox',width:960,height:600}); //调用框架
*
* 也可以整个覆盖(tips: 默认的无需写):
* - $(element).hDialog({
* box: '#demo',
* boxBg: '#eeeeee',
* modalBg: '#eeeeee',
* width: 500,
* height: 400,
* positions: 'top',
* effect: 'fadeOut',
* hideTime: 3000,
* isOverlay: false,
* modalHide: false,
* escHide: false,
* autoShow: false,
* autoHide: false,
* types: 1,
* iframeSrc: '',
* iframeId: 'iframeHBox',
* beforeShow: function(){ alert('执行回调'); },
* afterHide: function(){ alert('执行回调'); }
* });
*
* 下面是简单的扩展方法(以后再慢慢补充吧):
* - $.tooltip('错误提示文字'); 或者 $.tooltip('正确提示文字',4000,true,callback); //内置2种提示风格(参数1为提示文字,参数2为自动关闭时间,参数3:true为正确,false为错误,参数4: 回调函数)
* - $.showLoading('正在加载...',90,30); 或者 $.hideLoading(); //显示/移除加载(参数1为说明文字,参数2为宽度,参数3为高度,默认宽高为140*48,可不填写)
* - $.goTop(); //返回顶部,(参数1:和屏幕底部的距离,参数2:和屏幕右侧的距离; PS:自定义一定要加单位,比如px,em, 也可以是百分比哦)
* - $.dialog('alert','提示','hello'); 或者 $.dialog('confirm','提示','确认么?',0,function(){ alert('ok'); }); //消息框,(参数1:消息框类型(alert/confirm),参数2:消息框标题;参数3:消息框内容度;参数4:消息框自动关闭时间,以毫秒为单位(默认0:不自动关闭);参数5: 回调函数)
* - $.closeDialog(); 或者 $.closeDialog(function(){ alert('ok'); }); //关闭消息框,(参数1:回调函数)
*/
</pre>
</div>
</div><!-- demo end -->
<!-- 注意:请将要放入弹框的内容放在比如id="HBox"的容器中,然后将box的值换成该ID即可,比如:$(element).hDialog({'box':'#HBox'}); -->
<div id="HBox">
<form action="" method="post">
<ul class="list">
<li>
<strong>昵 称 <font color="#ff0000">*</font></strong>
<div class="fl"><input type="text" name="nickname" value="" required class="ipt nickname" /></div>
</li>
<li>
<strong>手 机 <font color="#ff0000">*</font></strong>
<div class="fl"><input type="text" name="phone" value="" required class="ipt phone" /></div>
</li>
<li>
<strong>邮 箱 <font color="#ff0000">*</font></strong>
<div class="fl"><input type="text" name="email" value="" required class="ipt email" /></div>
</li>
<li>
<strong>性 别 <font color="#ff0000"> </font></strong>
<div class="fl">
<label class="mr10"><input type="radio" name="sex" value="1"/>男</label>
<label class="mr10"><input type="radio" name="sex" value="2"/>女</label>
<label><input type="radio" name="sex" value="3"/>保密</label>
</div>
</li>
<li>
<strong>爱 好 <font color="#ff0000"> </font></strong>
<div class="fl">
<label class="mr10"><input type="checkbox" name="like" value="男" />男</label>
<label class="mr10"><input type="checkbox" name="like" value="女"/>女</label>
<label><input type="checkbox" name="like" value="都喜欢"/>都喜欢</label>
</div>
</li>
<li><input type="submit" value="确认提交" class="submitBtn" /></li>
</ul>
</form>
</div><!-- HBox end -->
</div><!-- box end -->
</div><!-- wrapper end -->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.hDialog.min.js"></script>
<script>
/**
+----------------------------------------------------------
* 内置扩展 [此部分可选]
+----------------------------------------------------------
*/
var $B = $('body'), $W = $(window);
$.extend({
/**
* @decription 给方法添加加载方法
* @param t : string 提示文字
* @param w : string 提示框宽度
* @param h : string 提示框高度
*/
showLoading: function(t, w, h) { //显示加载
t = t ? t : '正在加载...';
w = w ? parseInt(w) : 140;
h = h ? parseInt(h) : 48;
var closeBtn = '<a style="position:absolute;top:-5px;right:-5px;width:15px;height:15px;line-height:15px;display:inline-block;border-radius:50%;text-align:center;background-color:rgba(0,0,0,0.5);color:#fff;font-size:10px;" href="javascript:;" id="closeBtn">X</a>', margin = ""+parseInt(-(h/2))+'px 0 0 '+parseInt(-(w/2))+"px";
$('#HLoading').remove();
$B.stop().append('<div id="HLoading" style="width:'+w+'px;height:'+h+'px;line-height:'+h+'px;border-radius:4px;background:rgba(0,0,0,0.6);color:#fff;text-align:center;position:fixed;top:50%;left:50%;margin:'+margin+';">'+t+closeBtn+'</div>');
$('#closeBtn').on('click', function() {
$.hideLoading();
}); //关闭按钮点击事件
},
hideLoading: function() { //移除加载
$('#HLoading').remove();
},
/**
* @decription 给方法添加提示方法
* @param t1 : string 提示文字
* @param t2 : int 提示时间
* @param t3 : boolean 提示类型,默认为false
* @param callback : 回调函数
*/
tooltip: function(t1, t2, t3, callback) {
var tip = '', tipClassName = '', tipBgColor = '';
t1 = t1 ? t1 : 'Error...';
t2 = t2 ? parseInt(t2) : 3000;
if(t3) {
tipClassName = 'fadeInDown';
tipBgColor = '#5cb85c';
} else {
tipClassName = 'shake';
tipBgColor = '#D84C31';
}
tip = '<div class="HTooltip animated '+tipClassName+'" style="width:280px;padding:10px;text-align:center;background-color:'+tipBgColor+';color:#fff;position:fixed;top:10px;left:50%;z-index:100001;margin-left:-150px;box-shadow:1px 1px 5px #333;-webkit-box-shadow:1px 1px 5px #333;">'+t1+'</div>';
if($B.find(".toast-box").length == 0) {
$B.stop().append(tip);
} else {
$('.HTooltip').remove();
}
setTimeout(function() {
setTimeout(function() {
$('.HTooltip').remove();
callback && callback(); //隐藏后的回调方法
}, 1000);
}, t2);
},
/**
* @decription 返回顶部
* @param b : string 和屏幕底部的距离
* @param r : string 和屏幕右侧的距离
*/
goTop: function(b, r) {
b = b ? b : '30px';
r = r ? r : '20px';
$('#HGoTop').remove();
$B.stop().append('<a id="HGoTop" href="javascript:;" style="width:40px;height:40px;line-height:40px;border-radius:50%;display:inline-block;text-align:center;background:#333;color:#fff;position:fixed;bottom:'+b+';right:'+r+';z-index:100000;">Top</a>').find('#HGoTop').hide();
$T = $('#HGoTop');
$W.on('scroll', function() {
$W.scrollTop() > 150 ? $T.removeAttr('class').addClass('animated rollIn').show() : $T.removeAttr('class').addClass('animated rollOut');
});
$T.on('click', function() {
$('body,html').animate({ scrollTop:0 },500); return; //返回顶部按钮点击事件
});
},
/**
* @decription 消息框
* @param type : string 消息框类型(alert/confirm)
* @param title : string 消息框标题
* @param content : string 消息框内容
* @param time : int 消息框自动关闭时间,以毫秒为单位(默认0:不自动关闭)
* @param callback : 回调函数
*/
dialog: function(type, title, content, time, callback) {
var t, tpl = '', footerTpl = '', isLock = false, okText = '确定', cancelText = '取消', width = 260, margin = '0 0 0 '+parseInt(-(width/2))+'px', type = type != undefined ? type : 'alert', time = time != undefined ? parseInt(time) : 0,
headerTpl = '<div id="hDialog-header" style="border-bottom:1px solid #ddd;padding:10px;font-size:1.2em;color:#333;">' + title +'</div>',
okTpl = '<a href="javascript:;" style="padding:5px 10px;display:inline-block;border-radius:3px;background-color:#337ab7;color:#fff;" id="h_ok">'+ okText +'</a>',
cancelTpl = '<a href="javascript:;" style="padding:5px 10px;display:inline-block;border-radius:3px;margin-left:10px;background-color:#eee;color:#333;" id="h_cancel">'+ cancelText +'</a>',
contentTpl = '<div id="hDialog-content" style="padding:25px 15px;text-align:center;">' + content + '</div>',
maskTpl = '<div id="hDialog-mask" style="width:100%;height:100%;background-color:rgba(0,0,0,0.6);position:fixed;top:0;left:0;z-index:99999;"></div>';
if(type === 'confirm') {
footerTpl = '<div id="hDialog-footer" style="padding:10px;border-top:1px solid #ddd;text-align:right;">'+ okTpl + cancelTpl +'</div>';
}
if(!isLock) {
tpl += maskTpl;
}
tpl += '<div id="hDialog-wrap" class="animated fadeIn" style="width:'+width+'px;border-radius:5px;box-shadow:4px 4px 10px #666;-webkit-box-shadow:4px 4px 10px #666;background-color:#ffffff;border:1px solid #eee;position:fixed;top:35%;left:50%;margin:'+margin+';z-index:100000;">' + headerTpl + contentTpl + footerTpl + '</div>';
$('#hDialog-wrap, #hDialog-mask').remove();
$B.stop().append(tpl);
if(time !== 0) {
clearTimeout(t);
t = setTimeout(function() {
$.closeDialog(callback);
}, time);
}
$('a:contains('+okText+')').on("click", function() {
callback && callback();
});
$('a:contains('+cancelText+')').on("click", function() {
$.closeDialog();
});
},
/**
* @decription 关闭消息框
* @param callback : 回调函数
*/
closeDialog: function(callback) {
$('#hDialog-wrap, #hDialog-mask').remove();
callback && callback();
}
});
</script>
<script>
$(function(){
//打开效果调用,将动画效果的class放在data-type中即可
$('.dialog').hDialog();
//页面加载完成后自动执行
$('#HBox').hDialog({title:'页面加载完成后自动执行', autoShow: true, height: 350});
//demo:点击任何元素 自动关闭
// $('body').on('click', function(){
// $('#HBox').hDialog({autoHide: true});
// });
//带标题的
$('.demo0').hDialog({title: '测试弹框标题',height: 300, isOverlay: false});
//改变宽度
$('.demo1').hDialog({width: 500});
//改变高度
$('.demo2').hDialog({height: 400});
//改变宽和高
$('.demo3').hDialog({width:600,height: 500});
//改变位置
$('.demo4').hDialog({positions: 'bottom',effect: 'slideOutDown'});
//遮罩不可关闭
$('.demo6').hDialog({modalHide: false});
//改变弹框背景色
$('.demo7').hDialog({boxBg: '#eeeeee'});
//改变遮罩背景色
$('.demo8').hDialog({modalBg: 'rgba(255,255,255,0.7)'});
//错误文字提示
$('.demo10').click(function(){
$.tooltip('My God, 出错啦!!!');
});
//正确文字提示
$('.demo11').click(function(){
$.tooltip('OK, 操作成功!', 2500, true);
});
//显示加载
$('.demo12').click(function(){
//自定义文字: $.showLoading('玩命加载中...');
//自定义宽高: $.showLoading('努力加载中...',140,40);
$.showLoading();
});
//显示前的回调方法
$('.demo14').hDialog({beforeShow: function(){
alert('显示前执行');
}});
//隐藏后的回调方法
$('.demo15').hDialog({afterHide: function(){
alert('隐藏后执行');
}});
//fadeOut关闭效果
$('.demo16').hDialog({effect: 'fadeOut'});
//bounceOut关闭效果
$('.demo20').hDialog({effect: 'bounceOut'});
//bounceOutDown关闭效果
$('.demo21').hDialog({effect: 'bounceOutDown'});
//bounceOutLeft关闭效果
$('.demo22').hDialog({effect: 'bounceOutLeft'});
//bounceOutRight关闭效果
$('.demo23').hDialog({effect: 'bounceOutRight'});
//bounceOutUp关闭效果
$('.demo24').hDialog({effect: 'bounceOutUp'});
//fadeOutDown关闭效果
$('.demo25').hDialog({effect: 'fadeOutDown'});
//fadeOutLeft关闭效果
$('.demo26').hDialog({effect: 'fadeOutLeft'});
//fadeOutRight关闭效果
$('.demo27').hDialog({effect: 'fadeOutRight'});
//fadeOutUp关闭效果
$('.demo28').hDialog({effect: 'fadeOutUp'});
//flipOutX关闭效果
$('.demo29').hDialog({effect: 'flipOutX'});
//flipOutY关闭效果
$('.demo30').hDialog({effect: 'flipOutY'});
//lightSpeedOut关闭效果
$('.demo31').hDialog({effect: 'lightSpeedOut'});
//rotateOut关闭效果
$('.demo32').hDialog({effect: 'rotateOut'});
//rotateOutDownLeft关闭效果
$('.demo33').hDialog({effect: 'rotateOutDownLeft'});
//rotateOutDownRight关闭效果
$('.demo34').hDialog({effect: 'rotateOutDownRight'});
//rotateOutUpLeft关闭效果
$('.demo35').hDialog({effect: 'rotateOutUpLeft'});
//rotateOutUpRight关闭效果
$('.demo36').hDialog({effect: 'rotateOutUpRight'});
//slideOutUp关闭效果
$('.demo37').hDialog({effect: 'slideOutUp'});
//slideOutDown关闭效果
$('.demo38').hDialog({effect: 'slideOutDown'});
//slideOutLeft关闭效果
$('.demo39').hDialog({effect: 'slideOutLeft'});
//slideOutRight关闭效果
$('.demo40').hDialog({effect: 'slideOutRight'});
//zoomOut关闭效果
$('.demo41').hDialog({effect: 'zoomOut'});
//zoomOutDown关闭效果
$('.demo42').hDialog({effect: 'zoomOutDown'});
//zoomOutLeft关闭效果
$('.demo43').hDialog({effect: 'zoomOutLeft'});
//zoomOutRight关闭效果
$('.demo44').hDialog({effect: 'zoomOutRight'});
//zoomOutUp关闭效果
$('.demo45').hDialog({effect: 'zoomOutUp'});
//rollOut关闭效果
$('.demo46').hDialog({effect: 'rollOut'});
//定时关闭
$('.demo17').hDialog({hideTime: 2000});
//不显示遮罩
$('.demo19').hDialog({isOverlay: false});
//提示后回调
$('.demo47').click(function(){
$.tooltip('hello...',1000,true,function(){
$.tooltip('执行回调...');
});
});
//confirm
$('.demo48').click(function(){
$.dialog('confirm','提示','您确认要删除么?',0,function(){
$.tooltip('删除成功~',2000,true,function(){
//$.closeDialog();
$.closeDialog(function(){ alert('还可以回调了。'); });
});
});
});
//alert
$('.demo49').click(function(){
//$.dialog('alert','提示','正在处理中...'); 或者 $.dialog('alert','提示','正在处理中...',0); //不自动关闭
$.dialog('alert','提示','正在处理中...',2000,function(){ $.tooltip('执行回调...',2000,true); }); //2s自动关闭
});
//iframe
$('.demo50').hDialog({types:2,iframeSrc:'http://css.doyoe.com/',iframeId:'iframeHBox',width:960,height:600});
//返回顶部
$.goTop();
$('body').append('<footer style="width:94%;margin:0 auto;border-top:1px solid #ddd;padding:12px 0;text-align:center;color:#999;">©2014 <a target="_blank" href="http://www.hehaibao.com/">haibao</a>, All Rights Reserved. 版权所有,转载请注明出处!</footer>');
});
</script>
</body>
</html>