<div onclick="close()">关闭</div>
JS部分:
function close(){
document.getElementById("你这个浮动窗口的ID,例子中为extbkbox").style.display="none"
}
这样就关闭了~
<style type="text/css">.box {
position: relative
display: inline-block
}
.box .clear {
position: absolute
top: 0
right: 0
width: 16px
height: 16px
border: 1px solid #999
}
</style>
<div class="box">
<img src="images/testing.jpg" width="300" height="300" alt="" />
<div class="clear" onclick="this.parentNode.style.display='none'">X</div>
</div>