下面是代码,里面都有注释,可以直接运行。
在线演示 http://demo.jb51.net/js/2011/js_popup_up/index.htm
复制代码 代码如下:
body {padding:0; margin:0; font: 12px/1.5 Tahoma, Helvetica, Arial, sans-serif;}
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote,dl, dt, dd, ul, ol, li,pre,form, fieldset, legend, button, input, textarea,th, td {margin: 0;padding: 0;}
button, input, select, textarea {font: 12px/1.5 tahoma, arial, simsun, sans-serif;}
h1, h2, h3, h4, h5, h6 { font-size: 100%;font-weight:normal; }
address, cite, dfn, em, var { font-style: normal; }
code, kbd, pre, samp { font-family: courier new, courier, monospace; }
small { font-size: 12px; }
ul, ol { list-style: none; }
sup { vertical-align: text-top; }
sub { vertical-align: text-bottom; }
legend { color: #000; }
fieldset, img { border: 0; }
button, input, select, textarea { font-size: 100%; }
table { border-collapse: collapse; border-spacing: 0; }
.clear {clear:both;}
html { overflow:-moz-scrollbars-vertical; }
a { text-decoration: none;}
a:hover { text-decoration: underline;}
#pageOverlay {overflow:hidden;display:none;position:fixed; top:0; left:0; z-index:1987; width:100%; height:100%; background:#000; filter:alpha(opacity=70); opacity:0.7; }
.pageDialog{border: 4px solid #999999;display:none;position:fixed; top:40%; left:50%; z-index:1988;background:#fff;}
.pageDialog h3{padding-left:10px;overflow:hidden;font-size:14px;font-weight:normal;height:25px;line-height:25px;background:#666;color:#fff;zoom:1;}
.pageDialog h3 a{float:right;color:#ddd;display:inline;font-weight:bold;width:20px;text-align:center;margin-right:5px;}
.pageDialog h3 a:hover{ text-decoration: none;color:#fff;}
.pageDialog span{margin:10px;display: block;}
.pageDialog ./confirm/i,.pageDialog .concel{display:inline-block;background:#ccc url(../images/DialogBtn.png) no-repeat;width:45px;height:25px;text-align:center;line-height:25px;font-weight:bold;margin-right:10px;}
.pageDialog ./confirm/i:hover,.pageDialog .concel:hover{ text-decoration: none;}
.pageDialog ./confirm/i{background-position:0 0;color:#000;}
.pageDialog .concel{background-position:-45px 1px;color:#000;display:none;}
.oprate{margin:20px 0 10px 0;text-align:center;}
#test li{display:inline;}
- 自定义弹出层
- 自带模态对话框
- 右下角广告
这是第二个测试例子!x
右下角广告x



