how to hide div with jquery when click anywhere except one div?
本问题已经有最佳答案,请猛点这里访问。
我正在对Focus进行搜索输入,它显示一个带有以下选项的DIV:
1 2 3 4 5 | $("#search").focus(function(){ $("#options").fadeIn("fast"); }); |
我用这个函数隐藏了DIV
1 2 3 4 5 | $("#search").blur(function(){ $("#options").fadeOut("fast"); }); |
现在的问题是,即使用户单击
1 2 3 4 | $("#search").blur(function(e){ e.stopPropagation() $("#options").fadeOut("fast"); }); |