
cssParentSelector
allows the use of the new CSS4 parent selector today.cssParentSelector
allows the use of the new CSS4 parent selector today.Calculating time values and displaying them correctly is not child's play. There are lots of different units (Year, Month, Day, Hour etc.) and - more disturbing - different systems of numeration, none of which is decimal. But you need not fall into despair. Moment.js is there to help you. The small JavaScript library comes equipped with lots of nifty features for calculating time spans, converting international time formats and also cares for the output of the results. Needless to say that Moment.js works for different languages and time zones.
setTimeout
and setInterval
though. These do carry the disadvantage of simply repeating a function in defined intervals. Looking at animations, defined intervals are not the best way to make them work. If you have been using these two functions, you probably already experienced difficulties in finding the values for intervals in match with the required animation steps. Furthermore, setTimeout
and setInterval
rarely are in sync with the display refresh rate, which leads to the effect, that animations cannot be precisely presented. It doesn't have to be that way, though...