A knockout binding that is used to allow detection of clicking on another element i.e. "clicking off"
Parameters:
Name |
Type |
Description |
clickOff |
function
|
the function that is called when click off |
clickOff |
object
|
a configuration object with additional parameters to modify the behaviour of click off
Properties
Name |
Type |
Attributes |
Description |
handler |
function
|
|
the function that is called when click off |
includes |
Array.<string>
|
Array.<HTMLElement>
|
<optional>
|
an array of class names or html dom elements that when clicked on will invoke the handler |
excludes |
Array.<string>
|
Array.<HTMLElement>
|
<optional>
|
an array of class names or html dom elements that when clicked on will not invoke the handler |
|
- Source:
Examples
Passing a function to value accessor
clickOff: function() {
alert('it works!');
}
Passing an object with includes and excludes
clickOff: {
handler: function ( ) {
alert('it works!');
},
includes: ['clickOn', 'mainContent'],
excludes: ['clickOff', 'titleBar']
}