js 第一天

时间:2022-09-20 04:59:29

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script type="text/javascript" >
window.onload=function(){
var weibo=document.getElementById('weibo');
var content=document.getElementById('content');
var box=document.getElementById('box');

box.onmousemove=function(){

content.style.display="block";

}
box.onmouseout=function(){

content.style.display="none";

}
}

</script>

<style>

#box{
width: 400px;height: 400px;
}
#weibo{
font-size: 40px; width: 300px;text-align: center;
}
#box>#content{
height: 150px;width: 100%;background-color: yellow; text-align: center;line-height: 50px;display: none;
}
</style>

</head>
<body>
<div id="box">
<input type="button" value="微博" id="weibo" />

<div id="content">
<div class="a"> 文本1</div>
<div class="b"> 文本2</div>
<div class="c"> 文本3</div>
</div>
</div>
</body>
</html>