日期:2014-05-16 浏览次数:20355 次
<!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>会员信息</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<style type="text/css">
*{
margin:0;
padding:0;
}
.div{
float:left;
position:relative;
margin:100px;
}
.div_input{
width:50px;
height:25px;
border:1px solid #DCDCDC;
}
.yc_div{
width:200px;
height:100px;
border:1px solid #00BCF3;
position:absolute;
background:#099;
top:0;
left:52px;
}
</style>
<script>
window.onload=function(){
var y=document.getElementById('yc_div');
var it=document.getElementById('test1');
it.onclick=function(ev)
{
var oEvent=ev||event;
if(y.style.display=='none')
{
y.style.display='block';
}
else
{
y.style.display='none';
}
oEvent.cancelBubble=true;
}
document.onclick=function()
{
y.style.display='none';
}
}
</script>
</head>
<body>
<div class="div">
<input class="div_input" id="test1" type="text"/>
<div id="yc_div" class="yc_div" style="display:none;"></div>
</div>
</body>
</html>
<script type="text/java