Detecting Fonts Ready
Knowing when resources are loaded is a key part of building functional, elegant websites. We're used to using the
DOMContentLoaded event (commonly referred to as "domready") but did you know there's an event that tells you when all fonts have loaded? Let's learn how to use
document.fonts object features a
ready property which is a Promise representing if fonts have been loaded:
// Await all fonts being loaded
// Now do something! Maybe add a class to the body
Font files can be relatively large so you can never assume they've loaded quickly. One simply
document.fonts.ready gives you the answer!
With Firefox OS, asm.js, and the push for browser performance improvements, canvas and WebGL technologies are opening a world of possibilities. I featured 9 Mind-Blowing Canvas Demos and then took it up a level with 9 Mind-Blowing WebGL Demos, but I want to outdo...
Everyone loves dragging garbage files from their desktop into their trash can. There's a certain amount of irony in doing something on your computer that you also do in real life. It's also a quick way to get rid of things. That's...
One of the important functions of CSS is to position elements.
z-index are just a few of the major players in CSS positioning.
By using the above spacing...