summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-09-22 20:51:46 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-09-22 20:51:46 +0200
commitdd190c872b05e3d0d502235cbea089a7766e4177 (patch)
tree0c52c86e3ebb0fc564064dec6d2e963922c833dd /README.md
parent9fce07dc8c2e4772051c6944849d32420496a261 (diff)
downloadsvg.js-dd190c872b05e3d0d502235cbea089a7766e4177.tar.gz
svg.js-dd190c872b05e3d0d502235cbea089a7766e4177.zip
Added custom context binding for event callbacks
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0e8ce4d..e3be5e8 100644
--- a/README.md
+++ b/README.md
@@ -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: