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

Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.

Learn JavaScript for free!
Free course: Introduction to JavaScript

Yours when you take up a free 14-day SitePoint Premium trial.