javascript弹出一个层时怎么修改使得点击空白地方不能关掉一个层
1个回答
2017-08-01 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
<script type="text/javascript">
var EX = {
addEvent:function(k,v){
var me = this;
if (me.addEventListener)
me.addEventListener(k, v, false);
else if(me.attachEvent)
me.attachEvent("on" + k, v);
else
me["on" + k] = v;
},
removeEvent:function(k,v){
var me = this;
if (me.removeEventListener)
me.removeEventListener(k, v, false);
else if (me.detachEvent)
me.detachEvent("on" + k, v);
else
me["on" + k] = null;
},
stop:function(evt){
if(document.all)
{
window.detachEvent("on"+k,v);
}
else
{
window.removeEventListener(k,v,false);
}
document.body.removeChild(docEle(_id));
document.body.removeChild(docEle(m));
return false;
}
};
document.getElementById('pop2').onclick = EX.stop;
var url = '#';
function show2(){
var o = document.getElementById('pop2');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide2);});
}
function show3(){
var o = document.getElementById('pop3');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide3);});
}
function show4(){
var o = document.getElementById('pop4');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide4);});
}
function show5(){
var o = document.getElementById('pop5');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide5);});
}
function show6(){
var o = document.getElementById('pop6');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide6);});
}
function show7(){
var o = document.getElementById('pop7');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide7);});
}
function show8(){
var o = document.getElementById('pop8');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide8);});
}
function show9(){
var o = document.getElementById('pop9');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide9);});
}
function show10(){
var o = document.getElementById('pop10');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide10);});
}
function show11(){
var o = document.getElementById('pop11');
o.style.display = "";
setTimeout(function(){EX.addEvent.call(document,'click',hide11);});
}
function hide2(){
var o = document.getElementById('pop2');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide2);
}
function hide3(){
var o = document.getElementById('pop3');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide3);
}
function hide4(){
var o = document.getElementById('pop4');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide4);
}
function hide5(){
var o = document.getElementById('pop5');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide5);
}
function hide6(){
var o = document.getElementById('pop6');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide6);
}
function hide7(){
var o = document.getElementById('pop7');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide7);
}
function hide8(){
var o = document.getElementById('pop8');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide8);
}
function hide9(){
var o = document.getElementById('pop9');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide9);
}
function hide10(){
var o = document.getElementById('pop10');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide10);
}
function hide11(){
var o = document.getElementById('pop11');
o.style.display = "none";
EX.removeEvent.call(document,'click',hide11);
}
</script>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询