![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
求助大神js 点击显示下拉菜单,点击空白处隐藏
1个回答
展开全部
可以参考这个!
document.onclick = function(){
//隐藏层代码
};
div.onclick = function(oEvent){
//取消冒泡
oEvent = oEvent || window.event;
if(document.all){
oEvent.cancelBubble = true;
}else{
oEvent.stopPropagation();
}
};
document.onclick = function(){
//隐藏层代码
};
div.onclick = function(oEvent){
//取消冒泡
oEvent = oEvent || window.event;
if(document.all){
oEvent.cancelBubble = true;
}else{
oEvent.stopPropagation();
}
};
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询