diff options
author | wout <wout@impinc.co.uk> | 2014-01-23 21:18:43 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-01-23 21:18:43 +0100 |
commit | aaaf8f1f3ee676e5733f50114aff5717481f3bcf (patch) | |
tree | 3371202c48a76d02e01267114c14f7f65ad47e96 /README.md | |
parent | 820b56214181b561212e2b7ef2a3c636bcb836c8 (diff) | |
download | svg.js-aaaf8f1f3ee676e5733f50114aff5717481f3bcf.tar.gz svg.js-aaaf8f1f3ee676e5733f50114aff5717481f3bcf.zip |
Added the hyperlink element
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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 |