Click to See Complete Forum and Search --> : changing text size


stevepugh
02-17-2006, 06:41 PM
on the following site: www.cazenove.co.uk there is a "Text SizeAAA" function on the left side.

Can anyone tell how to do this?

I want to make the site I am building as accessible as possible and this seems to be a very good option to give partially sighted users. Also helps people who have no idea that they can increase text size in the view menu of their browser (I know a few!!!!)

Please help.

Cheers,

Steve

NogDog
02-17-2006, 06:52 PM
This part of the JavaScript does it:

function setStyle(style) {
setCookie("style",style,"","/","",false);
document.location.reload();
}

function getStyle() {
var styleID = getCookie("style");
if (styleID == null) {
return "1";
} else {
return styleID;
}
}

document.write("<link href=\"/includes/stylesheet"+ getStyle() +".css\" rel=\"stylesheet\" type=\"text/css\" />");

There are apparently 3 different style sheets. When you click one of those 3 links, it sets a cookie specifying a number from 1 to 3, then reloads the page. When the page loads, it looks for the cookie, and if it finds it uses that value to select which style sheet should be used.

WebJoel
02-17-2006, 07:23 PM
Click here

http://www.dynamicdrive.com/dynamicindex9/textsizer.htm

I used this script on an employment site that required accessibility for the physically disadvantaged, and the owner got good reviews for the site. Even though javascript isn't necessarily 'accessible' in terms of s. 508, in the event that it isn't accessible (like, javascript turned-off, or WebTV users, etc) the client/visitor only sees the native content 'in default size' specified in the rules/styles.

But if they allow javascript on their computer, the text will re-size upon demand and it looks really good! I can just image how much someone with sight problems would appreciate this effort!! (Images of my father reading his newpaper held out at full arm's length and still straining to see the words reminds me that it's not just the vernacular 'visually handicapped' that have sight problems... he has excellent vision 'at a distance' but at distances shorter than his arms... he is quite nearsighted.)

The site I mentioned above I re-did/updated in the past year without this script, but I still have a copy of the former site (avec script) in action in my own personal archives.

-Joel

stevepugh
02-19-2006, 01:57 PM
Thanks Joel. Very much appreciated.