Jquery - 单击 Div 外部以隐藏 Div
我正在使用这个: http://www.useful-dates.com/search/
我需要什么脚本使用以便滚动下方的滚动 div 保持隐藏,然后在您单击它时出现,并在您单击出现的 div 外部时消失?
像这样,但我没有运气复制: http://rob-bell.net/static/ddlist.html
我搜索并尝试过网上各种东西都没有,请帮忙。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
背景中必须有一些东西才能捕捉到点击声。看起来他们在工作示例中使用了 display: 具有固定高度/宽度的块,以便在下拉列表外部单击将点击事件所附加的“body”元素。
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.