<script type="text/javascript">
function fff(){
document.getElementById("show-menu").click(); //id为show-menu的按钮的单击事件(自己定义)
}
var i=0;
var btn=0;
document.onclick = function (event) {
event = event ? event : window.event;
var obj = event.srcElement ? event.srcElement : event.target;
if(obj.tagName == "BUTTON"){
btn++;
if(btn%2==0){
document.getElementById("asas").style.zIndex="";
return;
}else{
document.getElementById("asas").style.zIndex=1000;
}
// alert("btn"+document.getElementById("asas").style.zIndex);
}else{
document.getElementById("asas").style.zIndex="";
}
};
</script>
页面代码
<div style="position:relative">
<div id="asas" style="position:absolute;100%;height:100%;left:0px;top:0px;background:#000;filter:alpha(opacity=0);opacity:0" onclick="javascript:fff()"></div>
内容部分
</div>