I know this answer comes, perhaps too late, but I just parsed it:
function getTransitionDuration (el, with_delay){ var style=window.getComputedStyle(el), duration = style.webkitTransitionDuration, delay = style.webkitTransitionDelay; // fix miliseconds vs seconds duration = (duration.indexOf("ms")>-1) ? parseFloat(duration) : parseFloat(duration)*1000; delay = (delay.indexOf("ms")>-1) ? parseFloat(delay) : parseFloat(delay)*1000; if(with_delay) return (duration + delay); else return duration; }
The call getTransitionDuration (el) returns the duration value in ms. The call getTransitionDuration (el, true) returns the duration and delay in ms.
Please note that this is only a web kit, you will need a fix for the property name that matches all browsers.
I also experience a strange error when a 100 ms delay turns into something like 100.00000149011612 when getting a property.
http://jsfiddle.net/z3bKD/2/
source share