小程序收集实现一:
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<html>
<head>
<title>弹出式登录窗口 </title>
<style type="text/css">
a{
color:#000;
font-size:12px;
text-decoration:none;
}
a:hover{
color:#900;
text-decoration:underline;
}
#massage_box{
position:absolute;
left:expression((body.clientWidth-350)/2);
top:expression((body.clientHeight-200)/2);
350px;
height:200px;
filter:dropshadow(color=#666666,offx=3,offy=3,positive=2);
z-index:2; visibility:hidden;
}
#mask{
position:absolute;
top:0; left:0;
expression(body.scrollWidth);
height:expression(body.scrollHeight);
background:#666;
filter:ALPHA(opacity=60);
z-index:1;
visibility:hidden;
}
.massage{border:#036 solid; border-1 1 3 1; 95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}
.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}
</style>
<script language="javascript">
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMove
function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}
function MMove(){
if(Obj!=''){
document.all(Obj).style.left=event.x-pX;
document.all(Obj).style.top=event.y-pY;
}
}
function MUp(){
if(Obj!=''){
document.all(Obj).releaseCapture();
Obj='';
}
}
function d_x(){
mask.style.visibility='visible';
massage_box.style.visibility='visible'
}
function d_y(){
massage_box.style.visibility='hidden';
mask.style.visibility='hidden'
}
function login(){
var message = document.getElementById("message");
var name=document.getElementById("name").value;
var password=document.getElementById("password").value;
message.innerHTML="<ul><li>name:"+name+"</li><li>password:"+password+"</li></ul>";
}
</script>
</head>
<body>
<div id="massage_box">
<div class="massage">
<div class="header" onmousedown=MDown(massage_box)>
<div style="display:inline; 150px; position:absolute">登录连接 </div>
<span onClick="javascript:d_y();" style="float:right; display:inline; cursor:hand">× </span>
</div>
<ul style="margin-right:25">
<br /> 用户名:<input type="text" id="name"/>
<br /> 密 码:<input type="text" id="password"/>
<br />
<div style="text-align: center">
<br />
<input type="button" value="登录" onClick="javascript:login();javascript:d_y();"/>
<input type="button" value="取消" onClick="javascript:d_y();"/>
</div>
</ul>
</div>
</div>
<div id="mask" onClick="javascript:d_y();"> </div>
<span onClick="javascript:d_x();" style="cursor:hand"><a href="#">登录连接 </a> </span>
<br>
<div id="message"></div>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</body>
</html>
cnblog转贴