designMode
Every once in a while I stumble upon an API or browser setting that I can't believe ever existed. Such examples can be seen in the numerous String.prototype
properties such as bold
, italics
, and even blink
, which wrap given string text in their representative HTML tags. Bizarre.
It was recently brought to my attention the document.designMode
API: an on|off
switch that acts almost like a contentEdible
attribute for the entire document. You can toggle designMode
by simply changing the setting:
document.designMode = "on";
With the designMode
setting on, you can edit page text, drag and drop assets, and generally cause chaos on the page. This is really nice for prototyping; I'd have loved to have known about this while doing client work.
While I see uses for this API, it does feel a bit bizarre. I'd have liked to have known the origins of this property and its use cases. Have ideas about how you'd use it? Share!
I work with an awesome cast of developers at Mozilla, and one of them in Daniel Buchner. Daniel's shared with me an awesome strategy for detecting when nodes have been injected into a parent node without using the deprecated DOM Events API.
CSS animations are right up there with sliced bread. CSS animations are efficient because they can be hardware accelerated, they require no JavaScript overhead, and they are composed of very little CSS code. Quite often we add CSS transforms to elements via CSS during...
I released a MooTools comment preview script yesterday and got numerous requests for a jQuery version. Ask and you shall receive! I'll use the exact same CSS and HTML as yesterday.
The XHTML
The CSS
The jQuery JavaScript
On the keypress and blur events, we validate and...
The lightbox is probably one of my favorite parts of the Web 2.0 revolution. No more having to open new windows (which can bog down your computer quite a bit) to see a larger image, video, etc. Instead, the item loads right into the...
Hi David,
thanks for the trigger!
We digged deeper and unveiled the origin: https://twitter.com/slicknet/status/1180862121371811840
That was fun :-D