Create an Account
username: password:
 
  MemeStreams Logo

Controlling Font Size With Javascript

search

Lost
Picture of Lost
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Lost's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
Controlling Font Size With Javascript
Topic: Technology 2:55 pm EDT, Sep  5, 2008

The following script can be used to allow visitors to increase or decrease the size of text on your page. This can be useful for visitors who have trouble reading smaller text and allows them to increase it to something they can view more easily.
Decrease Font Size Increase Font Size

This script will change the font size of any text within a paragraph ( tag). If you wish to change text within other tags edit the getElementsByTagName('p'); part.

In order for this code to work your page must be using pixel sized fonts (px) rather than relative sized fonts using 'em' or '%'. Of course if you do use other font units the code can be easily adapted for these. If the script cannot find the font size of a paragraph it will default it to 12px.

Controlling Font Size With Javascript



 
 
Powered By Industrial Memetics
RSS2.0