473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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.

Jul 23 '05 #1
11 2350
dm**@yahoo.com wrote:
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.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2
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. 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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
Duwayne Sy wrote:
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.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #4
Why not set a browser cookie indicating which one of a set of CSS
stylesheets a user has selected?

You can override a FONT tag using CSS:

<html><head><title>test page</title>
<style>body, font{ font: 20pt Arial, sans-serif; }</style>
</head>
<body>
<p><font face="Times New Roman" size="2"><!-- sure enough: 20pt Arial!
-->hello</font></p></body>
</html>
Jul 23 '05 #5
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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #6
The issue is that users will be viewing HTML files authored by other
people. Those HTML files, when downloaded to our servers must not be
modified. So, they view the HTML file in this custom browser, and
sometimes they need the text (text for the whole document, not a
specific part of the document) to be bigger.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #7
Duwayne Sy wrote:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #8
Duwayne Sy wrote:
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!

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #9
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 and
basically just showing my own menu, I have access to the DOM through the
exposed interfaces. If there is a way to do it in javascript, assumming
that javascript will be accessing the DOM, then I can do it behind the
scenes without touching the source.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #10
Duwayne Sy wrote:
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.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #11
I would love to use Gecko. Unfortunately, because of development time,
we cannot use it. I hope someone write an ActiveX wrapper for Gecko that
exposes all the funcionality.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #12

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

Similar topics

19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
4
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
14
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I...
6
by: Lance Geeck | last post by:
I have a simple form where I am using a dataset called Client. On the data entry screen, there are name, address, city state and zip. I have the fields bound to the dataset field. (Properties...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
3
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file....
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
7
by: kirkgilbert | last post by:
I am trying to do an onchange event in a form using a text field. The form is tied to a record set that is part of a repeated region. One the first record when I edit the data it works perfectly. ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.