pixel2em Bookmarklet

Recently, I was writing a Javascript app that involved some animated, expanding boxes. While doing this, I realized I needed a way to dynamically convert pixels to computed ems. The function wasn't too complicated, and so I decided to make a bookmarklet out of it that did the same thing. It was kind of fun. Hopefully you'll find it useful, either in javascript, or to remove the headache when you're trying to create pixel-perfect designs using ems

Source (dtott.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%28function%28%29%7Bvar%2520script%3Ddocument.createElement%28%27script%27%29%3Bscript.src%3D%27http%3A//dtott.com/pixel2em/pixel2em.js%27%3Bdocument.getElementsByTagName%28%27head%27%29%5B0%5D.appendChild%28script%29%3B%7D%29%28%29


Rate it:


Tags:

Comments

Comments so far. Add yours.

Garowetz

Installed this but nothing happened ... so doesn't work

At least in Chrome