Text Size -> Largest, Larger, Medium, Smaller, Smallest

D

dmsy

Is there a way to use javascript to increase the overall document text
size, just like if you click View->Text Size->Largest, Larger, Medium,
Smaller, Smallest? This is on IE browser.
 
D

David Dorward

Is there a way to use javascript to increase the overall document text
size, just like if you click View->Text Size->Largest, Larger, Medium,
Smaller, Smallest? This is on IE browser.

You could dynamically alter the style.fontSize property of the body element
- but why bother? Browsers already come with a way for the user to choose
their font size, there's no need to muddy the water by duplicating
something the browser already does but which works only on one website.
 
D

David Dorward

Duwayne said:
I have tried that already and it does not work. It only changes the
size of text that does not have a size set. Text with size set by font
remains the same.

<font> is deprecated and should not be used.
If you specify your font sizes with font-size relative units (% or em are
typically the best choice) then this isn't an issue.
I need something that changes the whole document, just
as how the menu items work. I need this functionallity because I am
writting a custom browser for internal use. Some users have problems
seeing the default text size so they need to be able to resize it.

So why not add a font size preference to the browser?

} *** Sent via SPAMSPAMSPAM http://SPAMSPAMSPAMSPAMSPAMSP***
} Don't just SPAM USENET...get rewarded for it!

.... while failing to quote properly. Please find a real NNTP service rather
than this nasty spammy thing.
 
R

Randy Webb

Duwayne said:
The <font> tag is depricated, but it does not stop anyone from using it.

Idiots are born every minute.....
I have no control how other people author their HTML.

But since you are developing an "custom browser for internal use" then
you have control over how your "browser" displays that garbage code.
I am not trying to author the HTML, just want to change the size
when the users need to see bigger text.

Then let them use an existing browser that has that built in. Or, code
your "browser" so that it has a Size> Button or Menu that alters it.
 
D

David Dorward

Duwayne said:
The <font> tag is depricated, but it does not stop anyone from using it.
I have no control how other people author their HTML. I am not trying to
author the HTML, just want to change the size when the users need to see
bigger text.

If you have no control over the webpage, why are you asking how to use
JavaScript to alter it? JavaScript typically has to be referenced from the
page!
 
D

David Dorward

Duwayne said:
I am asking because when the HTML is loaded in a typical browser, the
DOM model is generated. Since I am reusing IE browser control

The IE browser control is very limited when it comes to font sizing. For
example, unless the user's preferences are to ignore all font sizing hits
whatsoever, any font sizes set using pt or px units will be impossible for
the user to resize. The only way to get round this is to alter the style
properties being applied to the element.

If you want decent font resizing then you should look at using a different
rendering engine. Gecko for instance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top