Font Sizer with Font Size in Em's

This example demonstrates using em's to set the body font size.

The argument passed to the adjust method, called onclick of the buttons, should be appropriate for the unit of measurement used, i.e., the sizeUnit property. For em's, .1 would be typical.




Over 2000+ free Javascript
at JavaScriptBank.com Website

Sampled by JavaScriptBank.com

All text in your document will be resized unless you specify selected page elements' font-size in pixels, points or constants (small, medium, etc.) in the style sheet. For example, the link to dyn-web below has a class attached with font-size set to 14px.

You can control the minimum and maximum sizes with property settings which you can set in dw_fontsizer.js or at the end of the document, as this example demonstrates.

Other code versions are also available.