By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,639 Members | 1,988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,639 IT Pros & Developers. It's quick & easy.

change font size in stylesheet class

P: n/a
Basic question, is this possible?

I have managed to crib a javascript function that allows the user to
increase or decrease the font size of a page. (see
http://www.northamptontoday.co.uk/Vi...ticleID=867063
for example. A+ A- in top right).

A div id is used to apply the function to text within that id.

My problem: I am working with a large intranet, all of the page
content is written in tables, therefore if I could have a function
which controlled the TH class, I could apply this to all the pages.

I'm no good with code, so you might have to spell it out, if you are
feeling benevolent?
Any help much appreciated
Ta
Luke
Jul 20 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
On 8 Oct 2004 02:40:24 -0700, lharby wrote:
Basic question, is this possible?

I have managed to crib a javascript function that allows the user to
increase or decrease the font size of a page.
Browsers already give the user the ability to
increase or decrease the font size.
..(see
http://www.northamptontoday.co.uk/Vi...ticleID=867063
for example. A+ A- in top right).
That breaks in Mozilla.

Error: document.all has no properties
Source File: http://...FontSizeFoot.js ...
A div id is used to apply the function to text within that id.
If the user needs the font bigger, why not make it bigger for
the entire page? Is the rest of the text simply unnecessary crap?
My problem: I am working with a large intranet,
A Win/IE intranet?
..all of the page
content is written in tables, therefore if I could have a function
which controlled the TH class, I could apply this to all the pages.


You could apply
body {
font-size: 100%;
}

Then link to instructions on how to zoom text in IE.
Alt V | X | G, - Alt V | X | A (largest and smallest).

It becomes a little more complicated if you have a mix
of browsers, but present instructions relevant to the user's
UA and everybody will be happy, getting the text size they
need at that moment on all pages, inbuilt.

[ Note: Follow-Ups set to c.i.w.a.stylesheets ]

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 20 '05 #2

P: n/a
In comp.infosystems.www.authoring.stylesheets,comp.lang.javascript
lharby said:
I have managed to crib a javascript function that allows the user to
increase or decrease the font size of a page.


if you didn't fuck around with the font size in the first place it
wouldn't be necessary to employ a dumb mindless newbie gimmick so the
visitor can change their font back to their preferred size. you're an
idiot.
--
l i t t l e v o i c e s
Jul 20 '05 #3

P: n/a
brucie wrote:
In comp.infosystems.www.authoring.stylesheets,comp.lang.javascript
lharby said:

I have managed to crib a javascript function that allows the user to
increase or decrease the font size of a page.

if you didn't f*** around with the font size in the first place it
wouldn't be necessary to employ a dumb mindless newbie gimmick so the
visitor can change their font back to their preferred size. you're an
idiot.


Luke - welcome to ciwas. Brucie does have a point, although I'd imagine
(and hope) that you didn't write the original content.

Leave it to the browser to resize fonts, if the original author was
inconsiderate enough to specify an inappropriate size.

--
Mark.
http://tranchant.plus.com/
Jul 20 '05 #4

P: n/a
"lharby" <lh****@gmail.com> wrote in
comp.infosystems.www.authoring.stylesheets:
I have managed to crib a javascript function that allows the user to
increase or decrease the font size of a page.


Why? Any decent browser can do this -- even a bad browser like MSIE
can do it to an extent.

Why do you feel compelled to reinvent the wheel, and make people
learn your interface instead of using the one in their browser?

That's a serious question.
(P.S. Javascript is the wrong way to do it in any event, since many
users will see nothing happen at all.)

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #5

P: n/a
> Why do you feel compelled to reinvent the wheel, and make people
learn your interface instead of using the one in their browser?


I hate to disillusion people: the browser used in our company is IE,
and *none* of our staff will realise that they can affect the font
size through the browser, I can assure you. (Maybe one or two at
most).

People seem to think that once they have reached some level of
competence, skill and expertise that everyone will suddenly be up to
their level. (I too am guilty of this). But most of our users are very
IT illiterate.

Thanks anyway.
Jul 20 '05 #6

P: n/a
lharby wrote:
I hate to disillusion people: the browser used in our company is IE,
and *none* of our staff will realise that they can affect the font
size through the browser, I can assure you. (Maybe one or two at
most).

People seem to think that once they have reached some level of
competence, skill and expertise that everyone will suddenly be up to
their level. (I too am guilty of this). But most of our users are very
IT illiterate.


If they want a bigger font, they will complain. Then you can show them
how to fix it, and they might remember.

--
Mark.
http://tranchant.plus.com/
Jul 20 '05 #7

P: n/a
lharby wrote:
Why do you feel compelled to reinvent the wheel, and make people
learn your interface instead of using the one in their browser?


I hate to disillusion people: the browser used in our company is
IE, and *none* of our staff will realise that they can affect the
font size through the browser, I can assure you. (Maybe one or
two at most).

People seem to think that once they have reached some level of
competence, skill and expertise that everyone will suddenly be
up to their level. (I too am guilty of this). But most of our
users are very IT illiterate.


If you problem is internal to one company sending everyone a general
e-mail telling them how to change the font size in IE would leave them
all informed, and for less effort than would be involved implementing
any mechanism to do it for them (which would still need to be documented
in help anyway (indeed a help entry under changing font size that just
described how IE facilitates it would probably satisfy any requirement
alone)).

But you will probably find that the minority who already know how to
change the font size in IE corresponds 100% with the individuals who
need/want to change the font size (the ones with less than perfect
eyesight, etc). The rest don't need the facility, and won't use it even
if you implement it.

Richard.
Jul 20 '05 #8

P: n/a
On 11/10/04 9:13 am, lharby wrote:
I hate to disillusion people: the browser used in our company is IE,
and *none* of our staff will realise that they can affect the font
size through the browser, I can assure you. (Maybe one or two at
most).


So why don't you just write a page that shows people how to change the
default font size in IE?

Surely that's a better solution than what you seem to be attempting at the
moment?

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 20 '05 #9

P: n/a
On 11 Oct 2004 01:13:23 -0700, lharby wrote:
Why do you feel compelled to reinvent the wheel, and make people
learn your interface instead of using the one in their browser?
I hate to disillusion people: the browser used in our company ...


[ Did you miss the 'w' in the 1st group's name? ]
..is IE,
and *none* of our staff will realise that they can affect the font
size through the browser,


So how will they 'realise' that little 'widget'/'button'
whatever resizes the text?

You will educate them, right? Perhaps have an eye-catcing image
beside it that links to a page that explains what it does?
In that case, have the explanation page give instructions
on resizing text in IE, using the IE menus.

[ It took me about 5 minutes to find the obtuse little buttons
you mentioned, even knowing they were there. 'Alt v | x | r' is
much simpler, if only web-designerd would not keep f*cking it up
with exact pixel sizes. ]

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 20 '05 #10

P: n/a
On Mon, 11 Oct 2004, lharby wrote:
I hate to disillusion people:
As my Mum taught me "blessed are they who expect nothing, for they
shall not be disappointed" ;-)
the browser used in our company is IE, and *none* of our staff will
realise that they can affect the font size through the browser, I
can assure you. (Maybe one or two at most).
How much more important it is, then, to concentrate effort on
educating those who need it, rather than frittering away effort on a
non-standard mechanism which only works on a small subset of the pages
that they will visit on the (ahem) *World* Wide web.
People seem to think that once they have reached some level of
competence, skill and expertise that everyone will suddenly be up to
their level. (I too am guilty of this). But most of our users are
very IT illiterate.
Absolutely. So the most important tool is the one called
"consistency". Never fob them off with some half-cocked substitute
(that only works under controlled conditions) for the real thing
(which can work anywhere).
Thanks anyway.


Do you know how rude that seems?

all the best
Jul 20 '05 #11

P: n/a
On 11 Oct 2004 01:13:23 -0700, lh****@gmail.com (lharby) wrote:
Why do you feel compelled to reinvent the wheel, and make people
learn your interface instead of using the one in their browser?


I hate to disillusion people: the browser used in our company is IE,
and *none* of our staff will realise that they can affect the font
size through the browser, I can assure you. (Maybe one or two at
most).

People seem to think that once they have reached some level of
competence, skill and expertise that everyone will suddenly be up to
their level. (I too am guilty of this). But most of our users are very
IT illiterate.


Here we go again. When it comes to Word and Excel and PDF files, zooming
the text is considered completely normal. Many, probably a majority, of
the Word/Excel/PDF files I receive are set to something other than 100%.
And only a few of them come from IT people. But if one dares to suggest
that people can do exactly the same in a browser, one gets accused of
being obscure and difficult.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #12

P: n/a
On Mon, 11 Oct 2004 10:10:42 +0100, Philip Ronan
<ph***********@virgin.net> wrote:
On 11/10/04 9:13 am, lharby wrote:
I hate to disillusion people: the browser used in our company is IE,
and *none* of our staff will realise that they can affect the font
size through the browser, I can assure you. (Maybe one or two at
most).
So why don't you just write a page that shows people how to change the
default font size in IE?


Something like http://www.xs4all.nl/~sbpoley/main/adjust.html for
example?


Surely that's a better solution than what you seem to be attempting at the
moment?


--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #13

P: n/a
Philip Ronan wrote:
So why don't you just write a page that shows people how to change the
default font size in IE?


Or better still, link to mine:
http://goddamn.co.uk/help/textsize/

My instructions can also be downloaded and adapted for use on your own
site. See:
http://goddamn.co.uk/help/textsize/webmasters

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 20 '05 #14

P: n/a
JRS: In article <MP************************@news.odyssey.net>, dated
Fri, 8 Oct 2004 10:18:42, seen in news:comp.lang.javascript, Stan Brown
<th************@fastmail.fm> posted :
"lharby" <lh****@gmail.com> wrote in
comp.infosystems.www.authoring.stylesheets:
I have managed to crib a javascript function that allows the user to
increase or decrease the font size of a page.


Why? Any decent browser can do this -- even a bad browser like MSIE
can do it to an extent.

Why do you feel compelled to reinvent the wheel, and make people
learn your interface instead of using the one in their browser?


<br>
<input type=button value="Font size"
onClick="this.value='Use Ctrl-Mousewheel; or View, Fonts'">
<br>

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #15

P: n/a
"Toby Inkster" <us**********@tobyinkster.co.uk> wrote in
comp.infosystems.www.authoring.stylesheets:
Or better still, link to mine:
http://goddamn.co.uk/help/textsize/


The auto-detect is interesting. Normally I hate auto-detect, but I
think this one is okay since it says "but it could be wrong" and
provides links to the other possibilities.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.