From 9acb1d161f16e59d104f68520965e25e1e2905fc Mon Sep 17 00:00:00 2001 From: Damir Kotoric Date: Wed, 11 Jun 2014 15:07:44 +1000 Subject: [PATCH] Take element height into consideration The colorise function now takes the element height into consideration when animating, which makes the animation look as intended when the switch is customised. --- switchery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/switchery.js b/switchery.js index 970b1e0..347f789 100644 --- a/switchery.js +++ b/switchery.js @@ -202,7 +202,7 @@ Switchery.prototype.setSpeed = function() { Switchery.prototype.colorize = function() { this.switcher.style.backgroundColor = this.options.color; this.switcher.style.borderColor = this.options.color; - this.switcher.style.boxShadow = 'inset 0 0 0 16px ' + this.options.color; + this.switcher.style.boxShadow = 'inset 0 0 0 ' + this.switcher.offsetHeight/2 + 'px ' + this.options.color; }; /**