Forum Moderators: coopster & phranque

Message Too Old, No Replies

simple script to allow users to adjust font?

similar to the FAST/AllTheWeb presentation

         

homegirl

10:42 pm on Jan 28, 2003 (gmt 0)

10+ Year Member



Newbie question here so apologies if this question is in the wrong place.

If I want to give visitors to a site the option to adjust font size up or down, is there a simple way to do this other than to create different versions of the same page?

I realize that these adjustments can be made in their browser but my concern is that there are many users who don't know this and thus, don't use this feature.

It's easy enough for me to create different .css files to handle the different font sizes. But is there a simpler way to access those different .css files other than via a hyperlink (which involves me creating multiple versions of the same page)?

Thanks!

garry

11:50 pm on Jan 28, 2003 (gmt 0)

10+ Year Member



I've seen this on the alltheweb homepage........maybe you will get a clue from that page?

jeremy goodrich

5:49 pm on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Easy enough to set a cookie on the users browser, and then if they want to change their prefs, set a cookie based on that. They could click something that does a server side redirect, so that you could set the cookie and then dump them back on the same page...

So you'd be serving the page from a database of some kind, and serving the css link from there based on what's in their cookie.

Though, there might be a more elegant way to do it than that, this method will do the job.

homegirl

6:21 pm on Jan 30, 2003 (gmt 0)

10+ Year Member



Thx Jeremy! I was hoping for a way to do it that doesn't involve cookies. I'm just not a huge cookies fan- and tend to disable all those sorts of settings on my browsers (and firewall). I appreciate the suggestion nonetheless. (And can't quite figure out what's going on at FAST/Lycos Networks thing with their feature of text size adjustability.)

RussellC

8:27 pm on Jan 30, 2003 (gmt 0)

10+ Year Member



Maybe you could do it in php/mysql...

Have a simple form that selects a number for the font size and font type, store it in a mysql database with the user auth info. And when they come to the site you have:

<font size="<?=$fontsize?>" face="<?=$fontface?>">Text</font>

It will pull the correct info from the DB, depending on how the user set it.

toadhall

8:49 pm on Jan 30, 2003 (gmt 0)

10+ Year Member


The problem with most of the solutions I've seen (and the one's I've written in Javascript and PHP) is the pages end up in the History and/or they don't work in all browsers.

The best I've seen so far is the Javascript available at [url]http://www.alistapart.com/stories/alternate/[/url]. No less than Wired News uses it. It doesn't work in all browsers BUT it doesn't produce a History list.

T

homegirl

2:58 am on Jan 31, 2003 (gmt 0)

10+ Year Member



Thx very much for the suggestions! It may take me a while to implement (whichever I decide) but I've got some good starting points now...