From: wout Date: Sun, 6 Jan 2013 11:11:09 +0000 (+0100) Subject: Updated README X-Git-Tag: 0.2~23 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5ff480264d9a62a77dde9568c8a5576b23b0298e;p=svg.js.git Updated README --- 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: