<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.site-nav {
height: 30px;
background-color: #ccc;
}
.top-banner {
background-color: orange;
}
.w {
width: 1200px;
height: 80px;
background-color: pink;
margin: 0 auto;
position: relative;
}
.search {
width: 1200px;
height: 80px;
background-color: lemonchiffon;
margin: 0 auto;
}
a {
position: absolute;
top: 10px;
right: 10px;
width: 25px;
height: 25px;
text-align: center;
line-height: 25px;
background-color: #000;
color: #fff;
text-decoration: none; }
</style>
</head>
<body>
<div class="site-nav"></div>
<div class="top-banner" style="opacity: 1">
<div class="w">
<a href="#">×</a>
</div>
</div>
<div class="search"></div> <script>
//获取事件源
var topBanner = document.getElementsByClassName("top-banner")[0];
var a = topBanner.children[0].firstElementChild || topBanner.children[0].firstChild;
//定义定时器
var timer = null;
a.onclick = function(){
timer = setInterval(function(){
topBanner.style.opacity -=.1;
if (topBanner.style.opacity < 0) {
topBanner.style.display = "none";
clearInterval(timer);
}
},50);
}
</script> </body>
</html>

最新文章

  1. windows下mysql数据库定时备份。
  2. 简单测试nginx1.90做TCP协议负载均衡的功能
  3. 【python】类的继承和多态
  4. SQL Server 查看物理页存储
  5. SpringMVC上传文件
  6. UITableView全面解析,讲的好详细
  7. type tips
  8. ubuntu 12.04 安装 nginx+php+mysql web服务器
  9. 【Tools】maven安装
  10. 用c语言程序对显存进行操作
  11. CVE-2014-0196(马拉松赛跑bug)
  12. Apache+Subversion+TortoiseSVN
  13. VBS基础篇 - 对象(3) - FileSystemObject对象
  14. Java(基础)的类与变量
  15. JAVA中接口的使用
  16. web 11
  17. C#、winform、wpf将类控件放进工具箱里
  18. linux下用户操作
  19. 目标检测(二) SPPNet
  20. WKWebView使用方法

热门文章

  1. tensorflow在windows下的安装
  2. 我的集合学习笔记--LinkedList
  3. js十大排序算法:冒泡排序
  4. JVM EXCEPTION_ACCESS_VIOLATION
  5. win10总是2分钟就自动睡眠怎么办 win10系统自动休眠bug怎么解决(转)
  6. reshape、shuffle、save_weights
  7. 使用Java HttpComponent/HttpClinet 调用 WebAPI问题的解决
  8. int ,Intege,String 三者之间的转换
  9. 如果filename的value有值 说明支持存储
  10. map内置函数分析所得到的思路