PDA

View Full Version : JS] JavaScript/CSS Font Size Changer



phpsales
05-16-2007, 09:26 PM
1) CODE TITLE:
JavaScript/CSS Font Size Changer (Persistent Between Pages)
2) AUTHOR NAME/NOTES:
DB Design (phpscriptindex.com)
3) DESCRIPTION:
Script will allow user to visually change font size. Font size will persist thru page change using a cookie.
4) URL TO CODE:
Demo: http://phpscriptindex.com/jsfontchanger.html
Source: http://phpscriptindex.com/jsfontchanger.txt
or, ATTACHED BELOW (see #3 in guidelines below):

mwinter
05-16-2007, 09:58 PM
JavaScript/CSS Font Size Changer (Persistent Between Pages)

I really dislike features like this. If authors stopped arsing around with the font size in the first place, the user would have no reason to want to change it. Moreover, if the user is really in a pinch, the browser will offer font resizing facilities, anyway.

phpsales
05-16-2007, 10:43 PM
I really dislike features like this. If authors stopped arsing around with the font size in the first place, the user would have no reason to want to change it. Moreover, if the user is really in a pinch, the browser will offer font resizing facilities, anyway.

I understand your point and thank you for your comments. Most people would agree features such as this one are written to satisfy the customer/user requirements. This feature was shared in the hope that it could be used to extend customer/user website usability. After all itís always nice to have features/scripts available when the need arises. Thanks again for your comments.

djr33
05-16-2007, 10:59 PM
Well, I agree with Mike, but there might be some cases where this is useful to someone. Perhaps a page where there is a lot of text and they wish to organize it for the most important items, etc.

It looks like a nicely functioning script and certainly has more potential for proper use than some other scripts we've seen, so I don't tnink it's worth just dismissing.

bayswater
10-26-2007, 04:46 PM
I like it - but what if you extract data from a database and have several posts where you would like the font to change for all of them at the same time? Can that be achieved?

boogyman
10-26-2007, 05:20 PM
I like it - but what if you extract data from a database and have several posts where you would like the font to change for all of them at the same time? Can that be achieved?

if you use proper coding techniques yes. What I mean by that is if you use one base size that you declare explicitly (usually in the body section of your css) then use percentages for everything else, well then anytime you change the font size, you would keep the same proportions.




I really dislike features like this. If authors stopped arsing around with the font size in the first place, the user would have no reason to want to change it. Moreover, if the user is really in a pinch, the browser will offer font resizing facilities, anyway.

although mike doesnt populate these forums anymore, there definitely is valid use for properly coded font changer script. accessibility wise you need to accomodate everyone, and you shouldn't be limitting the site to someone that has decent / good eyesite; sites should be expandable so if someone with really poor eye sight can adjust the size and not put exude excess energy in reading / interpretting a site.

molendijk
10-28-2007, 12:41 AM
I really dislike features like this. If authors stopped arsing around with the font size in the first place, the user would have no reason to want to change it. Moreover, if the user is really in a pinch, the browser will offer font resizing facilities, anyway.

Hello MWINTER,
I don't see any OBJECTIVE value in your reaction to this script. It helps people with poor eye-sight (like myself) a lot. This script is very useful to them. Don't let personal (subjective) judgements (that have nothing to do with coding, where do these judgments come from??) guide you in evaluating the work of others.

Arie M.

djr33
10-28-2007, 01:20 AM
No, he's right. Perhaps overly harsh, but right.

If you do have poor eyesight, you would simply set your browser to a larger text size by default. That's the whole reason it's embedded as a behavior in the browser.

But if you had this script on the page overriding your default choice, it would make it either hard to see or excessively large-- no point.

The only real use to such a script is for switching elements, sorta a zooming in look. Or if some users just like playing with font size. Dunno why, though.

molendijk
10-28-2007, 08:50 AM
No, he's right. Perhaps overly harsh, but right.

If you do have poor eyesight, you would simply set your browser to a larger text size by default. That's the whole reason it's embedded as a behavior in the browser.

But that's the problem. Certain people have difficulty in distinguishing the buttons on top of the screen. On the other hand, if they see a very big 'A' on the screen, they just click on it to enlarge the font size.

woa
08-23-2008, 12:15 PM
I'm interested in this script but don't know how to customize it.
I would like to change <span id="inner"> into <span class="inner"> because of the W3 recommendation (I have several blocks). But when I do that, it doesn't work anymore. I believe it's due to var fontElementId ? Thanks for your help !