{"id":21184519,"url":"https://github.com/gsantiago/jquery-clickout","last_synced_at":"2025-07-10T00:33:35.375Z","repository":{"id":57282031,"uuid":"55070867","full_name":"gsantiago/jquery-clickout","owner":"gsantiago","description":"Handle clickout events with jQuery","archived":false,"fork":false,"pushed_at":"2018-01-31T20:10:21.000Z","size":12,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-10T06:50:39.085Z","etag":null,"topics":["click","clickout","event","jquery","outside","plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gsantiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-30T14:41:00.000Z","updated_at":"2020-11-12T00:23:41.000Z","dependencies_parsed_at":"2022-09-18T19:02:12.883Z","dependency_job_id":null,"html_url":"https://github.com/gsantiago/jquery-clickout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsantiago%2Fjquery-clickout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsantiago%2Fjquery-clickout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsantiago%2Fjquery-clickout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsantiago%2Fjquery-clickout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gsantiago","download_url":"https://codeload.github.com/gsantiago/jquery-clickout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476376,"owners_count":17480215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["click","clickout","event","jquery","outside","plugin"],"created_at":"2024-11-20T18:09:12.026Z","updated_at":"2024-11-20T18:09:12.829Z","avatar_url":"https://github.com/gsantiago.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery Clickout\n\n[![Build Status](https://travis-ci.org/gsantiago/jquery-clickout.svg?branch=master)](https://travis-ci.org/gsantiago/jquery-clickout)\n[![Build Status](https://saucelabs.com/buildstatus/jquery_clickout)](https://saucelabs.com/beta/builds/5bf8eeee1e7b4f72b620ad07484e82b9)\n[![npm version](https://badge.fury.io/js/jquery-clickout.svg)](https://badge.fury.io/js/jquery-clickout)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![Code Climate](https://codeclimate.com/github/gsantiago/jquery-clickout/badges/gpa.svg)](https://codeclimate.com/github/gsantiago/jquery-clickout)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://saucelabs.com/u/jquery_clickout\"\u003e\n    \u003cimg src=\"https://saucelabs.com/browser-matrix/jquery_clickout.svg\" alt=\"Sauce Test Status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\njQuery plugin for handle outside clicks. It doesn't stop event propagation\nnor prevents default events.\n\nIt extends the jQuery Events and adds a new custom event: `clickout`.\n\nYou can use it normally with `on` and `off` methods:\n\n```js\n// Add a clickout listener\n$('button').on('clickout', function (e) {\n  console.log('click outside button')\n})\n\n// Remove a clickout listener\n$('button').off('clickout')\n```\n\nThe coolest feature is the multiple elements support:\n\n```js\n$('.js-button, .js-menu').on('clickout', function (e) {\n  console.log('click outside `js-button` and `js-menu`')\n  this.addClass('is-hidden') // now both $button and $menu have `is-hidden` class\n})\n\n\n$button.add($menu).on('clickout', function () {\n  console.log('click outside `js-button` and `js-menu`')\n  this.addClass('is-hidden') // now both $button and $menu have `is-hidden` class\n})\n```\n\n## Installation\n\n```npm install jquery-clickout --save```\n\nOr just copy `jquery-clickout.min.js` from this repository, in the `dist`\nfolder.\n\n## Usage\n\nJust use `clickout` like a normal event. Very very easy:\n\n```javascript\n$('.my-element').on('clickout', function (e) {\n  console.log('Outside element click')\n  console.log(this) // jQuery instance of `.my-element`\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsantiago%2Fjquery-clickout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsantiago%2Fjquery-clickout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsantiago%2Fjquery-clickout/lists"}