PDA

View Full Version : renderReadability()



annies44
01-14-2006, 07:08 AM
Can anyone give me some info on how to set this up in website... where I can find some code for this?

Thanks

Twey
01-14-2006, 11:35 AM
Certainly, if you give us some info as to what on earth you're actually trying to do. A single function name isn't much of a giveaway, you know.

annies44
01-14-2006, 11:24 PM
No problem.... I want to have the ability for my visitors to enlarge the font size. I saw a website that offered that. They actually had two larger sizes that the people could click on to use. http://abcnews.go.com/Travel/story?id=1486744&page=1

You will notice that it's under the banner at the top on the right-hand side.

Thanks.

Twey
01-15-2006, 12:12 AM
Most browsers already implement this. In Firefox, it's under View->Text Size.
Nevertheless, this ought to work:

<a href="javascript:void(0);" onclick="
var fs = document.body.style.fontSize;
document.body.style.fontSize = (
isNaN(parseFloat(fs))
? '18pt'
: (parseFloat(fs) + 2) + fs.substring(parseFloat(fs).toString().length)
);
">Increase Font Size</a>

<a href="javascript:void(0);" onclick="
var fs = document.body.style.fontSize;
document.body.style.fontSize = (
isNaN(parseFloat(fs))
? '18pt'
: (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length)
);
">Decrease Font Size</a>

<a href="javascript:void(0);" onclick="
document.body.style.fontSize = '18pt';
">Default Font Size</a>Change "18pt" in all links to font sizes better suited to your site as a default. Tested only in Firefox, and that with only a very simple DOM.