All Projects → gsantiago → jquery-clickout

gsantiago / jquery-clickout

Licence: other
Handle clickout events with jQuery

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jquery-clickout

three-onEvent
Add an EventListener for Object3d in your three.js project.(support click,hover or gaze)
Stars: ✭ 55 (+139.13%)
Mutual labels:  event, click
dead-simple
💀💡 Dead simple PubSub and EventEmitter in JavaScript
Stars: ✭ 21 (-8.7%)
Mutual labels:  event
XKCD
A minimal command line tool for your daily dose of xkcd comics written in python. Feel free to contribute!
Stars: ✭ 67 (+191.3%)
Mutual labels:  click
ever
Callback-less event reactor for Ruby
Stars: ✭ 79 (+243.48%)
Mutual labels:  event
HorizontalTimesLayout
Layout to display time slots in horizontal 24 hour format
Stars: ✭ 31 (+34.78%)
Mutual labels:  event
DevSoc21
Official website for DEVSOC 21, our annual flagship hackathon.
Stars: ✭ 15 (-34.78%)
Mutual labels:  event
laravel-broadcast-demo
Article: Laravel PWA to implement Broadcasting
Stars: ✭ 17 (-26.09%)
Mutual labels:  event
php-event-manager
PHP event manager. simple, fully functional event management dispatcher implementation. 简洁,功能完善的事件管理实现,支持快速的事件组注册,设置事件优先级,通配符事件的监听。
Stars: ✭ 25 (+8.7%)
Mutual labels:  event
evtx
C# based evtx parser with lots of extras
Stars: ✭ 162 (+604.35%)
Mutual labels:  event
ClickableWebView
Simple WebView to Detect click on an image
Stars: ✭ 42 (+82.61%)
Mutual labels:  click
EventEmitter
Simple EventEmitter with multiple listeners
Stars: ✭ 19 (-17.39%)
Mutual labels:  event
Unity-EventBinder
User Interface Event decoupler
Stars: ✭ 27 (+17.39%)
Mutual labels:  event
Android-Touch-Helper
开屏跳过-安卓系统的开屏广告自动跳过助手
Stars: ✭ 488 (+2021.74%)
Mutual labels:  click
evon
Fast and versatile event dispatcher code generator for Golang
Stars: ✭ 15 (-34.78%)
Mutual labels:  event
Nephos
Project Nephos [GSoC '18]: Automated recording, processing, and uploading of TV streams for Universities.
Stars: ✭ 20 (-13.04%)
Mutual labels:  click
tiny-typed-emitter
Fully type-checked NodeJS EventEmitter
Stars: ✭ 96 (+317.39%)
Mutual labels:  event
DebounceMonitoring
📑 Add debounce logic for any method in a single line.
Stars: ✭ 44 (+91.3%)
Mutual labels:  click
talks
This repository exists to help organize and discuss new talks.
Stars: ✭ 19 (-17.39%)
Mutual labels:  event
UniTaskPubSub
UniTask & IUniTaskAsyncEnumerable baseed pub/sub messaging. this is like the UniTask version of UniRx.MessageBroker.
Stars: ✭ 61 (+165.22%)
Mutual labels:  event
Events
社区举办过的活动信息
Stars: ✭ 17 (-26.09%)
Mutual labels:  event

jQuery Clickout

Build Status Build Status npm version js-standard-style Code Climate

Sauce Test Status

jQuery plugin for handle outside clicks. It doesn't stop event propagation nor prevents default events.

It extends the jQuery Events and adds a new custom event: clickout.

You can use it normally with on and off methods:

// Add a clickout listener
$('button').on('clickout', function (e) {
  console.log('click outside button')
})

// Remove a clickout listener
$('button').off('clickout')

The coolest feature is the multiple elements support:

$('.js-button, .js-menu').on('clickout', function (e) {
  console.log('click outside `js-button` and `js-menu`')
  this.addClass('is-hidden') // now both $button and $menu have `is-hidden` class
})


$button.add($menu).on('clickout', function () {
  console.log('click outside `js-button` and `js-menu`')
  this.addClass('is-hidden') // now both $button and $menu have `is-hidden` class
})

Installation

npm install jquery-clickout --save

Or just copy jquery-clickout.min.js from this repository, in the dist folder.

Usage

Just use clickout like a normal event. Very very easy:

$('.my-element').on('clickout', function (e) {
  console.log('Outside element click')
  console.log(this) // jQuery instance of `.my-element`
})
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].