diff options
author | Rémi Tétreault <tetreault.remi@gmail.com> | 2016-10-17 16:28:51 -0400 |
---|---|---|
committer | Rémi Tétreault <tetreault.remi@gmail.com> | 2016-10-17 16:28:51 -0400 |
commit | 5da860377ecc0a936cf9c974ffe934f773504f96 (patch) | |
tree | eea0683201658bd42776746da5468d8253a7c276 /src | |
parent | 7db574d979e02369bdfcfe2a0f90a60380d63f68 (diff) | |
download | svg.js-5da860377ecc0a936cf9c974ffe934f773504f96.tar.gz svg.js-5da860377ecc0a936cf9c974ffe934f773504f96.zip |
Add speed to SVG.Element and also add documentation to speed
Diffstat (limited to 'src')
-rw-r--r-- | src/fx.js | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -115,7 +115,7 @@ SVG.FX = SVG.invent({ /** * sets or returns the target of this animation - * @param null || target SVG.Elemenet which should be set as new target + * @param null || target SVG.Element which should be set as new target * @return target || this */ , target: function(target){ @@ -335,7 +335,11 @@ SVG.FX = SVG.invent({ return this.step(true) } - // set/get the speed of the animation + /** + * sets or returns the speed of the animations + * @param spd null || Number The new speed of the animations + * @return Number || this + */ , speed: function(spd){ if (spd === 0) return this.pause() @@ -668,6 +672,16 @@ SVG.FX = SVG.invent({ return this } + // Set/Get the speed of the animations + , speed: function(spd) { + if (this.fx) + if (spd == null) + return this.fx.speed() + else + this.fx.speed(spd) + + return this + } } }) |