PDA

View Full Version : One click to make text size bigger for readers



iKwak
10-15-2004, 05:09 PM
I saw this feature on one website.

Website viewers can choose their preferance on font size (small, normal, large, extra large) by clicking on a button.
If you click on the image, all the texts on that page gets smaller, larger, and etc. and it does it instantaneously. Meaning, it does not direct you to another page with a different font size but rather it is the same page and all the text size changes size.


Do you happen to know how to accomplish this? One of my site has small font texts and I sometimes have a bit problem reading it myself. I like to give the viewers their choice on font size.

Chris
10-15-2004, 06:26 PM
If its instantaneous like that its probably JS powered, so you could just view the source to see how.

chromate
10-16-2004, 03:57 AM
Yep, javascript / DHTML. IKwak, try this page, http://www.dansteinman.com/dynduo/en/changingstyles.html (scroll right down)

That Dynamic Duo site is really handy for things like this.

intelliot
10-17-2004, 12:24 AM
Wired.com does it with a combo of Javascript and CSS.


// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/
//
// nifty StyleSwitcher scripts modified by Aaron Jones 10/10/2002
// ----------------------------------------------

function setActiveStyleSheet(title, reset) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
if (reset == 1) {
createCookie("wstyle", title, 365);
}
}

davesplace1
10-22-2004, 08:24 PM
Larger text is a good thing for us "middle aged" surfers :). I had not seen this on a site yet, but it sure sounds like a good thing to me. I will have to test it on one of my sites.

iKwak
10-22-2004, 09:33 PM
I appreciate all for the responses. :cool:

Xander
10-23-2004, 05:56 AM
I've seen quite a few sites specifiying alternative css, which shows up as an option in mozilla. E.g. Vinne Garcia's old site http://old.vinniegarcia.com/ - option shows in Mozilla but IE needs javascript I think.