Jquery - 点击外部Div隐藏一个Div [英] Jquery - Click outside Div to Hide a Div

查看:99
本文介绍了Jquery - 点击外部Div隐藏一个Div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是:
http://www.useful-dates.com/搜索/



我需要使用哪些脚本,以便滚动的div下面的滚动处于隐藏状态,然后在您单击时显示,并在您单击外部时消失的出现div?



像这样,但我没有运气重复:
http://rob-bell.net/static/ddlist.html



Iv搜索并尝试在网络上的各种事情,没有运气,请帮助。

解决方案

有些事情必须在后台赶上单击。看起来他们在工作示例中使用了具有固定高度/宽度的display:block,以便在下拉菜单之外的点击会触及附加事件的body元素。

I am using this: http://www.useful-dates.com/search/

What script do I need to use so that the scrolled underneath scrolled div stays hidden and then appears when you click it and disappears when you click outside of the appears div?

Like this, but i have had no luck duplicating: http://rob-bell.net/static/ddlist.html

Iv searched and tried all kinds of things on the net and no luck, please help.

解决方案

Something has to be there in the background to catch the click. Looks like they used display: block with a fixed height/width in the working example, so that a click outside the drop-down would hit the "body" element, to which the event is attached.

这篇关于Jquery - 点击外部Div隐藏一个Div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆