angular-off-click

Its like click, but when you don't click on your element.
Homepage:
12 people use it
Submitted by: 664714?v=3 TheSharpieOne

angular-off-click

Its like click, but when you don't click on your element.

Other Feautes Ability to choose elements outside of your element that will not trigger the off-click event. Ability to pass an expression to determine of the off-click event should trigger.

Usage/Example Here we have a slide out navigation div that will appear when the user clicks a button. We want the div to go away when they click off of it (off-click). We also want to make sure the button that triggers the div to open, also does initial close it (off-click-filter).

<button id="nav-toggle">Show Navigation</button> <div id="slide-out-nav" ng-show='showNav' off-click='showNav = false' off-click-filter='#nav-toggle' off-click-if='showNav'> ... </div>

The off-click attribute is the expression or function that will execute each time the user doesn't click on your element (or filter) The opitonal off-click-filter attribute is a comma separated list of selectors that will not trigger off-click when they are clicked. Thr optional off-click-if attribute is an expression that will determine if the off-click should trigger or not.

comments powered by Disqus
This page was last updated about 3 years ago.