473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

change font size in stylesheet class

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 23 '05 #1
14 2347
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 23 '05 #2
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 23 '05 #3
"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 23 '05 #4
> 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 23 '05 #5
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 23 '05 #6
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 23 '05 #7
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 23 '05 #8
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 23 '05 #9
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 23 '05 #10
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 23 '05 #11
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 23 '05 #12
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 23 '05 #13
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 23 '05 #14
"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 23 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Michael Hill | last post by:
I have a perl script that i use to render a html page. In that page i call out a stylesheet. If the user has a 800x600 display the fonts are really too big. Since screen resolution is a function...
4
by: Matt | last post by:
When the user resize the browser, the "Frequently Used Link" and "Table 1" and "Table 2" will shift to the left hand side, but table position is unchanged. I really have no idea how to fix that. I...
15
by: lharby | last post by:
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...
3
by: bigoxygen | last post by:
Hi. I have a list that is similar to this: -Evaluation +test +test -Students +test I would like to change the "-" bullet only, but I cannot. My
3
by: Mike Barnard | last post by:
Hi all, newbie here. Odd sounding subject but I can't describe it any better. I'm trying to teach myself a little about CSS. In a test site (not published) I am trying to use CSS to make...
7
by: Tim Rogers | last post by:
Hi folks, this is a resolution-detect script that I used on a site. As you can see it is designed to detect when the screen resolution falls below a certain level then load an alternative style...
5
by: studentofknowledge | last post by:
hi guys im new to javascript and need some guidence please.. im trying to display a 400x400 pixel coloured area in the middle of a webpage that stays in the middle with a browser window resize....
0
by: cleary1981 | last post by:
Hi, Heres my xsl stylesheet. Its work in progress but it works. What I want to do however is to make one page in the middle (drawings) a landscape page. Can anyone explain how to do this as all...
1
by: sgxbytes | last post by:
Hi, i have an xsl and xml,i need to replace the tag position from one location to another . xsl: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
6
by: gavy7210 | last post by:
hello i am using struts 1.2,Eclipse Platform Version: 3.4.2,mySql 5.0.1,jdk 1.5.. i have a login form(jsp) in which a user logs in,in case he doesnt enter his username and/or password an error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.