Guest Post: Save Text Size Preference Using MooTools and PHP

I have posted a major update to my original post about Changing Text Size onClick with JavaScript at the David Walsh Blog.

It allows you to store your users’ text-size preferences in a cookie so that they don’t have to resize the text to their liking on every page. Check out the demo (remember to refresh the page to test the cookie!) and then check out how to Save Text Size Preference using MooTools and PHP!

Javascript: Measure those “em”s for your layout

For many of us designing fluid layouts, which are generally based in “em”s (pronounced like the letter M) you end up not really knowing how many pixels an “em” is while you are deep in the DOM tree. This is especially confusing if you increase/decrease text size with your browser.

For this reason, I have created a simple Javascript function that you can use to poll any element on your test page and figure out what size an “em” is.

Staples of the Bookshelf: ppk on JavaScript

Peter-Paul Koch explains how to create beautiful JavaScript and shows you how to combine it with proper HTML and CSS for the best web experience in ppk on JavaScript. Here is my review.

The structure of this book

ppk begins with a brief history of JavaScript and explains the “fat and thin” JavaScript cycle. I would agree with him on that we are in a fattening state right now, but I think the tides will turn soon (my guess is before 2010).

Then ppk gives a basic overview of accessibility (which he adds to later) before introducing us to the 8 real world scripts used as examples in this book: