麻烦各位帮我看一下代码,关闭按钮没有反映,请问问题出在哪里,谢谢!!!
<style type="text/css">
.rightAd{
height:300px;
width:400px;
background:#ccc;
position:fixed;
right:5px;
bottom:0px;
}
.CloseBtn{
background:url(icon.jpg) no-repeat -399px -19px;
width:16px;
height:16px;
display:none;
position:absolute;
top:5px;
right:5px;
}
.CloseBtn:hover{
background-position: -343px -19px;
}
.Flex{
background:#CCC;
height:24px;
line-height:24px;
position:relative;
text-align:center;
}
</style>
<script type="text/javascript">
window.onload=function(){
var TipBox=document.getElementById("tipCon");
var CloseBtn=document.getElementById("CloseBtn");
var Flex=document.getElementById("Flex");
var Eddie=document.getElementById("Eddie");
Flex.onmouseover = function(){
Eddie.style.display = 'block';
CloseBtn.style.display = 'block';
}
CloseBtn.onclick = function(){
Eddie.style.display = 'none';
CloseBtn.style.display = 'none';
}
}
</script>
</head>
<body>
<div class="rightAd" id="tipCon">
<div class="Flex" id="Flex">鼠标来这里</div>
<div class="CloseBtn" id="CloseBtn">
<a href="javascript:void(0);" ></a>
</div>
<div class="Eddie" id="Eddie">
<a href="http://www.imooc.com">
<img src="Eddie.jpg" />
</a>
</div>
</div>
</body>