87,989
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script>
var target = -200;
var timer;
function showDiv(){
var Obj = document.getElementById("qqbar");
if(target<0){
Obj.style.left = ++target+"px";
timer = window.setTimeout(showDiv,5);
}else{
clearTimeout(timer);
}
}
function hideDiv(){
var Obj = document.getElementById("qqbar");
if(target>-200){
Obj.style.left = --target+"px";
timer = window.setTimeout(hideDiv,5);
}else{
clearTimeout(timer);
}
}
</script>
</head>
<body>
<br/>
<br/>
<input type="button" value="浮动窗口" id="btn"/>
<div id='qqbar' style="width:210px;height=300px;background='blue';position:relative;left:-200px; "
onmouseover="showDiv();" onmouseout="hideDiv();" >
<table>
<tr>
<td>
姓名:<input type="text" id="name"><br>
密码:<input type="password" id="password">
</td>
</tr>
</table>
</div>
</body>
</html>