Created
January 22, 2015 06:43
-
-
Save ollien/2ac102422fe0d101bd8f to your computer and use it in GitHub Desktop.
Convert CSS transition-duration to ms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeStringtoTime(s){ | |
if (s.indexOf('ms')!=-1){ | |
var result = s.replace('ms',''); | |
console.log(result); | |
return parseInt(result); | |
} | |
else{ | |
var result = s.replace('s',''); | |
return parseFloat(result)*1000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment