1 $(document).bind("click",function(e){ 2 var target = $(e.target); 3 if(target.closest("#parentId").length == 0){//点击id为parentId之外的地方触发 4 layer.close(tip_index); 5 type=0; 6 } 7 })
jq实现点击某元素之外触发事件
原文:http://www.cnblogs.com/xujingyang/p/7607652.html