Currently I am working on an plugin for jQuery. In some jQuery functions you can pass an duration (e.g. '500ms', '1s', 'fast') parameter in.
I suppose there is a function within jQuery which pares that value and returns a value in ms? (so 1s would return 1000 or something).
Which method would this be, and is it possible to use this in my own plugin? So I can fire an callback after '1s' or 'fast' like some other methods as animate currently does.
You can always have a look at the source code. There you can see that
.animate()calls a methodjQuery.speedwhich usesjQuery.fx.speeds:jQuery.speedseems to be useful in this regard, though I don’t see any code which converts'1s'into1000. Are you sure jQuery is doing this?