<html>
<head>
<style type="text/css">
#hide{
width:75%;height:80px;background:skyblue;display:block;
}
.hander{cursor:pointer;}
input{
margin:5 0 0 900;
}
</style>
<script>
//不用window.onload也可以
document.documentElement.onclick = function(){
document.getElementById('hide').style.display = 'none';
}
//阻止冒泡事件方法
function stopPropagation(e) {
e = e || window.event;
if(e.stopPropagation) { //W3C阻止冒泡方法
e.stopPropagation();
} else {
e.cancelBubble = true; //IE阻止冒泡方法
}
}
//方法必须要放在window.onload下
window.onload = function(){
document.getElementById("hide").onclick = function(e){
stopPropagation(e);
}
document.getElementById('btn_show').onclick = function(e) {
document.getElementById('hide').style.display = 'block';
stopPropagation(e);
}
} </script>
</head>
<body>
<div id="hide" class="hander">click here nothing happen,you can click beside this area</div>
<input type="button" id="btn_show" value="show" class="hander"/>
</body>
</html>

  

最新文章

  1. oracle 误删数据恢复
  2. CSS清除浮动八种方法
  3. SSRS动态设置文本框属性
  4. MSYS2 安装和配置
  5. 【HDOJ】4418 Time travel
  6. Delphi从内存流中判断图片格式(好多相关文章)
  7. Swift分割字符串
  8. spring boot跨域问题
  9. Linux的快捷键一
  10. [解决]IP地址非法,请接入联通热点后重新获取
  11. C++随记
  12. [Visual Studio] [Config] [Transformation] [SlowCheetah] 在非Web工程中使用Transformation
  13. VSTS 免费代码git/tfs托管体验-使用代码云托管
  14. 对比几种在ROS中常用的几种SLAM算法
  15. kafka window环境搭建
  16. 将图片文件转化为字节数组字符串,并对其进行Base64编码处理,以及对字节数组字符串进行Base64解码并生成图片
  17. x86,x64,Any CPU区别
  18. CSS 常用语法与盒模型分析
  19. 如何将JQUERY对象转成Javascript对象
  20. 用docker搭建php+nginx+laravel的开发环境

热门文章

  1. 「USACO16OPEN」「LuoguP3147」262144(区间dp
  2. php获取YouTube视频信息的方法
  3. NLTK vs SKLearn vs Gensim vs TextBlob vs spaCy
  4. dubbo 自定义过滤器,打印接口调用信息
  5. 联想Y450在Ubuntu下调节屏幕亮度
  6. QC使用常见问题
  7. DispatcherServlet详解
  8. ElasticSearch基础之映射mapping
  9. Sping中使用Junit进行测试
  10. 51nod1770(xjb)