js 点击 隐藏弹出层

document.onmousedown = function(e){
  var ev = document.all ? window.event : e;
  var _con = $("#cicon"); // 设置目标区域
  if(!_con.is(e.target) && _con.has(e.target).length === 0){ // Mark 1
    if(!$("#cicon").is(":hidden")){
      $("#cicon").toggle();
    }
  }
}
posted @ 2017-12-09 17:35  itvita  阅读(1171)  评论(0编辑  收藏  举报