aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2016-10-17 16:28:51 -0400
committerRémi Tétreault <tetreault.remi@gmail.com>2016-10-17 16:28:51 -0400
commit5da860377ecc0a936cf9c974ffe934f773504f96 (patch)
treeeea0683201658bd42776746da5468d8253a7c276 /src
parent7db574d979e02369bdfcfe2a0f90a60380d63f68 (diff)
downloadsvg.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.js18
1 files changed, 16 insertions, 2 deletions
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
+ }
}
})