From 5da860377ecc0a936cf9c974ffe934f773504f96 Mon Sep 17 00:00:00 2001 From: Rémi Tétreault Date: Mon, 17 Oct 2016 16:28:51 -0400 Subject: Add speed to SVG.Element and also add documentation to speed --- src/fx.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/fx.js') diff --git a/src/fx.js b/src/fx.js index fc05284..916ffee 100644 --- a/src/fx.js +++ b/src/fx.js @@ -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 + } } }) -- cgit v1.2.3