Chinaunix首页 | 论坛 | 博客
  • 博客访问: 837105
  • 博文数量: 182
  • 博客积分: 1992
  • 博客等级: 上尉
  • 技术积分: 1766
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-18 11:49
文章分类

全部博文(182)

文章存档

2019年(1)

2016年(5)

2015年(29)

2014年(38)

2013年(21)

2012年(36)

2011年(52)

我的朋友

分类: Java

2014-04-11 13:45:59


点击(此处)折叠或打开

  1. $(document).mouseup(function(e) {
  2.         var cityContainer = $("#hiddenDiv");
  3.         var townContainer = $("#townList");
  4.         if (!cityContainer.is(e.target) // if the target of the click isn't the container...
  5.                 && cityContainer.has(e.target).length === 0) // ... nor a descendant of the container
  6.         {
  7.             cityContainer.hide();
  8.         }
  9.         
  10.         if (!townContainer.is(e.target) // if the target of the click isn't the container...
  11.                 && townContainer.has(e.target).length === 0) // ... nor a descendant of the container
  12.         {
  13.             townContainer.hide();
  14.         }
  15.     });

阅读(836) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~