summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-01-23 21:18:43 +0100
committerwout <wout@impinc.co.uk>2014-01-23 21:18:43 +0100
commitaaaf8f1f3ee676e5733f50114aff5717481f3bcf (patch)
tree3371202c48a76d02e01267114c14f7f65ad47e96 /README.md
parent820b56214181b561212e2b7ef2a3c636bcb836c8 (diff)
downloadsvg.js-aaaf8f1f3ee676e5733f50114aff5717481f3bcf.tar.gz
svg.js-aaaf8f1f3ee676e5733f50114aff5717481f3bcf.zip
Added the hyperlink element
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/README.md b/README.md
index a509115..9486311 100644
--- a/README.md
+++ b/README.md
@@ -342,6 +342,33 @@ var use = draw.use(rect).move(200, 200)
In this way the rect element acts as a library element. You can edit it but it won't be rendered.
+### Hyperlink
+A hyperlink or `<a>` tag creates a container that enables a link on all children:
+
+```javascript
+var link = draw.link('http://svgjs.com')
+var rect = link.rect(100, 100)
+```
+
+The link url can be updated with the `to()` method:
+
+```javascript
+link.to('http://apple.com')
+```
+
+Furthermore, the link element has a `show()` method to create the `xlink:show` attribute:
+
+```javascript
+link.show('replace')
+```
+
+And the `target()` method to create the `target` attribute:
+
+```javascript
+link.target('_blank')
+```
+
+
## Referencing elements
### By id