<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>div浮动层</title>
</head>
<body>
<div style="padding-top: 20px;">
<input type="submit" name="" value="浮动层"onclick="javascript:showDiv()" />
</div>
</body>
<div id=win style="display:none; POSITION:absolute; left:50%; top:50%; width:400px; height:180px; margin-left:-230px; margin-top:-50px; border:1px solid #888; background-color:#FF0000; text-align:center">
<div style="clear: both;"></div><!--撑开位置折行-->
<li class="form-item action-verifycode" ><label style="width: 200px; height:30px;">让我们确定您不是机器人</label></li>
<a style="margin:25px 0px 25px 3px;" href="#" onclick="closeLogin()" class="btn" ><span><span>取消</span></span></a>
</div>
</body>
</html>
<script>
function showDiv(){
document.getElementById(‘win‘).style.display=‘block‘;
}
function closeLogin(){
document.getElementById("win").style.display="none";
var h = document.getElementById("id_verifycode");
h.removeClass(‘disabled‘);
var a=document.getElementById ("span");
a.innerHTML = "重发验证码";
}
</script>本文出自 “熊科泉” 博客,请务必保留此出处http://kequan.blog.51cto.com/10815369/1784931
原文:http://kequan.blog.51cto.com/10815369/1784931