diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-09-22 20:51:46 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-09-22 20:51:46 +0200 |
commit | dd190c872b05e3d0d502235cbea089a7766e4177 (patch) | |
tree | 0c52c86e3ebb0fc564064dec6d2e963922c833dd /README.md | |
parent | 9fce07dc8c2e4772051c6944849d32420496a261 (diff) | |
download | svg.js-dd190c872b05e3d0d502235cbea089a7766e4177.tar.gz svg.js-dd190c872b05e3d0d502235cbea089a7766e4177.zip |
Added custom context binding for event callbacks
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2873,6 +2873,12 @@ var click = function() { rect.on('click', click) ``` +**Note:** The context of `this` in the callback is binded to the element. You can change this context by applying your own object: + +```javascript +rect.on('click', click, window) // context of this is window +``` + __`returns`: `itself`__ Unbinding events is just as easy: |