87,997
社区成员




if (document.all)
window.document.attachEvent("onclick",gorush);
else
window.document.addEventListener("click",gorush,false)
function gorush(){
var jmp=document.getElementById("jmpArea");
var obj;
if(document.all)
{
obj = event.srcElement ;
}
else
{
obj = arguments[0].target;
}
var ev=obj.id;
ev=ev.substring(0,3);
if(ev !="bsi")
{ jmp.style.display="none";return;}
}
function ShowProgressInfoN(evt)
{
evt=evt ? evt : (window.event ? window.event : null);
var jmpArea=document.getElementById("jmpArea");//jmpArea是个<div>
//...
jmpArea.style.display='block';
}
<div id="bsiaaaa" > 请点击这里</div> <div id="jmpArea">1111111111111111111</div>
document.addEventListener("click",doclick,false);
里最后一个属性设置该事件的响应顺序;
true的话将是最先触发
顺序为 addEventListener->标签的onclick事件->document.onclick
false的话是最后触发
顺序为 标签的onclick事件->document.onclick->addEventListener
<div id="bsiaaaa" onclick="javascript:ShowProgressInfoN(event);return false;" > 请点击这里</div> <div id="jmpArea">1111111111111111111</div>