Hi,

A simple script for enlarging/reducing text:

function textResize()
{
        document.body.style.fontSize = '1em';
        document.getElementById('increase').onclick = function()
        {
                var textSize = 
parseFloat(document.body.style.fontSize.replace('em', ''));
                textSize += 0.25;
                document.body.style.fontSize = textSize + 'em';
        }
        document.getElementById('decrease').onclick = function()
        {
                var textSize = 
parseFloat(document.body.style.fontSize.replace('em', ''));
                textSize -= 0.25;
                document.body.style.fontSize = textSize + 'em';
        }
}

window.onload = textResize;

Just add some buttons or whatever with the IDs 'increase' and 'decrease' and 
Robert's your mother's brother.  Of course, as mentioned before this is wholly 
dependent on Javascript being enabled in the user's browser.

Iain

Jough wrote:
The best method I've found is to swap out stylesheets using
Javascript; here's an article on how to do that, including the script should you choose this method:

Couldn’t you set a font size of 1em (standard) within the body{} in your stylesheet and use the javascript below to resize?

document.getElementByTagName(“body”).style.fontSize=’1.2em’;

You could throw this into a function that would increment the font size up/down by .1 or .2 every time. Of course this still wont work with javascript disabled…

Just a thought.  I’ve never tried it myself.

Jough



*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to