Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Outclick

Trigger callback, when click outside element.

Dependencies

  • Jquery >= 1.11.3

Usage

$(element).outclick({
callback: function() { $(this).hide() }
});

It is also possible to pass related objects. When you click on related object, action will not be considered as click outside main object bounds.

$(element).outclick({
callback: function() { $(this).hide() },
related: [$(element1), $(element2)]
});

Sometimes you can have multiple elements, with same structure.

$(element).each(function() {
$(this).outclick({
callback: function() { $(this).hide() },
related: [
$(this).siblings('.sibling1'),
$(this).siblings('.sibling2')
]
});
});

Sometime you need to add a related objects at a certain moment.

$(element).outclickAddRelated$(element1)

Sometime you to remove a related objects at a certain moment

$(element).outclickRemoveRelated$(element1)

Install and Build

  • Install all packages
$ npm install
  • Build
$ gulp build
# OR
$ npm run build

About

Trigger callback, when click outside element.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages