633

Jquery - Click outside Div to Hide a Div

Question:

I am using this: <a href="http://www.useful-dates.com/search/" rel="nofollow">http://www.useful-dates.com/search/</a>

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: <a href="http://rob-bell.net/static/ddlist.html" rel="nofollow">http://rob-bell.net/static/ddlist.html</a>

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

Answer1:

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.

Recommend

  • Difference between \\z and \\Z and \\a and \\A in Perl
  • Playing an alert if a script has an error
  • Servlet interface is not a javax.servlet.Servlet
  • Is dynamic compilation in a 'ASP.NET Web Application' possible?
  • Calling an IDL script in Python
  • How do I import data in one pillar file from another?
  • Database for Full Text Search and 200M+ Records
  • How to keep from duplicating path variable in ksh
  • New BFC “clearing” floating boxes
  • Get Quarters StartDate and EndDate from Year
  • KeyDown not picking up 'Return' key C#
  • MS SQL Server 2008 :Getting start date and end date of the week to next 8 weeks
  • Context menu disappears when opened with Key.App
  • Add a div to replace Video after Video Plays Through
  • Aggregating two data frame columns without any existing pattern logic
  • Sliding transition animation between Screens in Caliburn Micro
  • How to read data from a text file if the file location is not known in c#?
  • View/Download Pdf Files in React - Router 4
  • data.table replicate rows after join?
  • C# List of Panels
  • How to autopopulate a field in SugarCRM form
  • Differences in dis-assembled C code of GCC and Borland?
  • Scala multiline string placeholder
  • Select options in sencha touch is not working for android
  • Display images in Django
  • Word Open XML Mail Merge
  • Get one-time binding to work for ng-if
  • Is there any way to access browser form field suggestions from JavaScript?
  • Why ng-show works with ng-repeat but ng-if doesn't? [duplicate]
  • Get object from AWS S3 as a stream
  • Cross-Platform Protobuf Serialization
  • Validaiting emails with Net.Mail MailAddress
  • sending/ receiving email in Java
  • jquery mobile loadPage not working
  • Do I've to free mysql result after storing it?
  • Data Validation Drop Down Box Arrow Disappearing
  • How to delete a row from a dynamic generate table using jquery?
  • Proper way to use connect-multiparty with express.js?
  • How do you join a server to an Active Directory (domain)?
  • Checking variable from a different class in C#