Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change font size in stylesheet class

5 views
Skip to first unread message

lharby

unread,
Oct 8, 2004, 5:40:24 AM10/8/04
to
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/ViewArticle.aspx?SectionID=317&ArticleID=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

Andrew Thompson

unread,
Oct 8, 2004, 6:16:31 AM10/8/04
to
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

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

Message has been deleted

Mark Tranchant

unread,
Oct 8, 2004, 7:05:00 AM10/8/04
to
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/

Stan Brown

unread,
Oct 8, 2004, 10:18:42 AM10/8/04
to
"lharby" <lha...@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/

lharby

unread,
Oct 11, 2004, 4:13:23 AM10/11/04
to
> 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.

Mark Tranchant

unread,
Oct 11, 2004, 4:59:21 AM10/11/04
to
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/

Richard Cornford

unread,
Oct 11, 2004, 5:06:31 AM10/11/04
to

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.


Philip Ronan

unread,
Oct 11, 2004, 5:10:42 AM10/11/04
to
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
phil.r...@virgin.net
(Please remove the "z"s if replying by email)


Andrew Thompson

unread,
Oct 11, 2004, 5:37:58 AM10/11/04
to
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. ]

Alan J. Flavell

unread,
Oct 11, 2004, 8:04:30 AM10/11/04
to
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

Stephen Poley

unread,
Oct 11, 2004, 1:40:22 PM10/11/04
to

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/

Stephen Poley

unread,
Oct 11, 2004, 1:40:30 PM10/11/04
to
On Mon, 11 Oct 2004 10:10:42 +0100, Philip Ronan
<phil.r...@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/

Toby Inkster

unread,
Oct 11, 2004, 2:01:19 PM10/11/04
to
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

Dr John Stockton

unread,
Oct 11, 2004, 4:13:40 PM10/11/04
to
JRS: In article <MPG.1bd06bc85...@news.odyssey.net>, dated
Fri, 8 Oct 2004 10:18:42, seen in news:comp.lang.javascript, Stan Brown
<the_sta...@fastmail.fm> posted :

>"lharby" <lha...@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.

Stan Brown

unread,
Oct 11, 2004, 7:33:11 PM10/11/04
to
"Toby Inkster" <usenet...@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.

0 new messages