aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-06 12:11:09 +0100
committerwout <wout@impinc.co.uk>2013-01-06 12:11:09 +0100
commit5ff480264d9a62a77dde9568c8a5576b23b0298e (patch)
treeb2dfe70b9fee141d6dd77c1651cf051fe2e23c99
parented023c001d44994adb415a79b6ed82c2858fbb33 (diff)
downloadsvg.js-5ff480264d9a62a77dde9568c8a5576b23b0298e.tar.gz
svg.js-5ff480264d9a62a77dde9568c8a5576b23b0298e.zip
Updated README
-rw-r--r--README.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/README.md b/README.md
index 577b7d8..eac78f3 100644
--- a/README.md
+++ b/README.md
@@ -337,6 +337,7 @@ rect.animate().center(200, 200);
```
Finally, you can add callback methods using `after()`:
+
```javascript
rect.animate(3000).move(100, 100).after(function() {
this.animate().attr({ fill: '#f06' });
@@ -350,10 +351,17 @@ Fill and stroke are used quite often. Therefore two convenience methods are prov
### Fill
The `fill()` method is a pretty alternative to the `attr()` method:
+
```javascript
rect.fill({ color: '#f06', opacity: 0.6 });
```
+A single hex string will work as well:
+
+```javascript
+rect.fill('#f06');
+```
+
### Stroke
The `stroke()` method is similar to `fill()`:
@@ -361,6 +369,12 @@ The `stroke()` method is similar to `fill()`:
rect.stroke({ color: '#f06', opacity: 0.6, width: 5 });
```
+Like fill, a single hex string will work as well:
+
+```javascript
+rect.stroke('#f06');
+```
+
### Rotate
The `rotate()` method will automatically rotate elements according to the center of the element: