Jquery - Click outside Div to Hide a Div

2019-09-16 14:14发布

问题:

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.

回答1:

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.



标签: html hide show