6 jQuery Click Outside Event Plugins

By Sam Deering

Web today is focusing more on click events than hovers, a new set of challenges for front-end web stars. In this post, you will see a collection of 6 jQuery Click Outside plugins. With these plugins you can now easily show an element when clicking on a trigger and hiding it again, and trigger stuff. ;)

1. jQuery outside events

With this plugin you can bind to an event that will be triggered only when a specific “originating” event occurs outside the element in question. Also, if an outside event hasn’t been provided by default, you can easily define your own.
jQuery outside events

2. clickoutside jQuery plugin

A small plugin to jQuery that adds the event of clicking outside an element. You know sometimes you should close some modal windows when clicking outside. It’s really simple and small.
clickoutside jQuery

3. jQuery-Clickout

jQuery plugin for to track clicks outside of an element.
Source + Demo

4. Close dropdowns by clicking outside of them with jQuery

It’s relatively easy with jQuery to show an element when clicking on a trigger and hiding it again using the .toggle method..
Close dropdowns by clicking outside

5. jQuery: Click and/or focus outside & -webkit-tap-highlight-color

A better way to detect focus/click outside of a target element..
Click and/or focus outside

6. How to hide a DOM popup clicking outside

Now I want to explain a useful feature, close a popup clicking outside the element.
hide a DOM popup clicking outside
Source + Demo

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in JavaScript, once a week, for free.