View Full Version : Button for Increase font size

07-09-2007, 12:42 PM

If you navigate to http://www.new.3genergi.co.uk


Notice the mini toolbar just above each pages content - with the two arrows and the A+ and A-.

I want the A+ and A- to automatically increase and decrease the text size of all elements on the page. Having tried a couple and not being able to get them to work - does anybody have any they can recommend - thanks

Also how will I use them i have an image map setup atm as follows:

<area shape="rect" coords="0,0,40,35" href="javascript:history.go(-1);">

so i presume i can do javascript:function();">

Thanks guys


07-09-2007, 01:31 PM
check this out

07-09-2007, 03:47 PM
with a bit of a push and modding this will settle in fine - nice script seen it before but didnt take the time to understand / implement it.

Having done that its looking quite nice... nearly!

07-09-2007, 04:04 PM
I donít knowÖ I think to separate style from functionality (which is the preferred way) it would probably be better to do this with some kind of stylesheet switcher. That means you have different stylesheets with different font sizes and with JavaScript you just switch the stylesheets, i.e. the font sizes. Thatís not only cleaner, itís also a lot easier to maintain.

Karen S. Garvin
07-09-2007, 04:30 PM
That means you have different stylesheets with different font sizes and with JavaScript you just switch the stylesheets

I understand why you'd use different stylesheets, but wouldn't using a JavaScript to change between them be a problem for broswsers that weren't allowing JavaScript? I surf with NoScript (http://noscript.net/) turned on at work, so I'm always having to "allow script." It's a pain, but it keeps my work machine clean (I think it does, anyway! :rolleyes: )

Anyway, could the same thing be accomplished with a PHP script? Wouldn't that be better tolerated by browsers?

07-09-2007, 05:14 PM
Yea im sure it could, except in php it can sometimes be a haslte getting it to function alongside a CMS - like im using.

07-09-2007, 06:52 PM
Well, my philosophy is (and this is where "graceful degradation" comes into the game) that there would always be a standard style/font size and the buttons to change the size (switch the stylesheets) would be generated by JS, too, so effectively this means if you have JS disabled you won't even see any option to resize the text on the page itself (you'd still be able to use the browser's built-in function). After all, this is only an additional feature and not required to read the page.

With PHP there would be additional requests to the server and the page is reloaded entirely which will increase the necessary bandwidth and make such a simple feature really bloated, I guess.

Karen S. Garvin
07-09-2007, 07:01 PM
I wonder what else I'm not seeing with the NoScript turned on. :rolleyes:

I routinely use the browser's ability to increase font size when I'm reading online for any length of time, but it sometimes breaks the page. Other times it just turns into elephant-sized text and is ridiculously large to try and read. Where I've seen the option to change point size on a site it usually works much nicer.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum