473,502 Members | 7,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.body.style.zoom

I am trying to implement font changer, where I have links on the
banner of the site and when the user clicks on the links, the font
size of the page has to change. I tried
document.body.style.fontSize='50%' for example, on an onclick() event,
but it did not work.

I tried zooming with the following code, and it works:

<td valign="baseline"><a href="#" onclick="(document.body.style.zoom)?
document.body.style.zoom/=1.2:document.body.style.zoom=1/1.2">A-
&nbsp;</a></td>

<td valign="baseline"><a href="#"
onclick="document.body.style.zoom=1">A&nbsp;</a></td>

<td valign="baseline"><a href="#" onclick="(document.body.style.zoom)?
document.body.style.zoom*=1.2:document.body.style. zoom=1.2">A+</a></
td>

But, I have a question. This is zooming the text on the page we are
on. But, when we go to another page on the site, this is not carried
forward (the zoom factor). Is there a way to do that?

Also, is there a way to not zoom the left and top navigation bars, but
just zoom the content page?

Thanks in advance for any suggestions,
jnag

Jun 1 '07 #1
3 15571
On Jun 1, 11:50 am, jnag <prajy...@gmail.comwrote:
I am trying to implement font changer, where I have links on the
banner of the site and when the user clicks on the links, the font
size of the page has to change. I tried
document.body.style.fontSize='50%' for example, on an onclick() event,
but it did not work.
Why didn't that work? It should. Is the font size in you CSS cascade
blocking this from working?

Peter

Jun 5 '07 #2
On Jun 5, 6:23 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 1, 11:50 am,jnag<prajy...@gmail.comwrote:
I am trying to implement font changer, where I have links on the
banner of the site and when the user clicks on the links, the font
size of the page has to change. I tried
document.body.style.fontSize='50%' for example, on an onclick() event,
but it did not work.

Why didn't that work? It should. Is the font size in you CSS cascade
blocking this from working?

Peter
Yes, I think the font size in the CSS is preventing this from working.
But, I am not sure how to fix it.
Thanks.

Jun 6 '07 #3
On Jun 6, 12:26 pm, jnag <prajy...@gmail.comwrote:
On Jun 5, 6:23 pm, Peter Michaux <petermich...@gmail.comwrote:
On Jun 1, 11:50 am,jnag<prajy...@gmail.comwrote:
I am trying to implement font changer, where I have links on the
banner of the site and when the user clicks on the links, the font
size of the page has to change. I tried
document.body.style.fontSize='50%' for example, on an onclick() event,
but it did not work.
Why didn't that work? It should. Is the font size in you CSS cascade
blocking this from working?
Peter

Yes, I think the font size in the CSS is preventing this from working.
But, I am not sure how to fix it.
If it is a CSS cascade issue then look into CSS cascade rules and how
the CSS selectors vary in priority. I think that would be the safest
thing to do. Trying to fix this with JavaScript is hacking for sure.
If you use the Firefox Firebug plugin you can easily see which rules
are being blocked by other rules in the cascade.

Peter

Jun 6 '07 #4

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

Similar topics

13
9584
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
2
2213
by: briano | last post by:
Is there a library that allows editing Word documents in the browser that is browser independent? Please forgive this question. Just trying to cover all bases. So far what I see is HTML or RTF...
10
2820
by: Zeez | last post by:
Hello! I'm looking for a way to stretch an HTML page. I found a way to zoom into a web page by using this code: body.style.zoom = 200%. (this piece of code magnifies the page 2 times larger)...
0
1630
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I am creating a webpage and opening it as a Word document. Problem is that as I create one of the questions, some of the text is not appearing in the document as it should. As I step through it, I...
6
7213
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to...
5
3403
by: jhurrell | last post by:
I have been having some trouble getting my XSL style sheet to parse correctly. I have some XML outputted from an SQL-Server, that I then need to turn into multiple HTML files. This I have done...
0
2510
by: srk | last post by:
hi to all, i need some help , my problem is that i have to generate a word document withe the data from data base and it should be displayed as tables in word and i have to insert some header and...
4
2605
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an...
0
2203
by: krishnagovindaraj | last post by:
Hi, I have to create word document with header and footer..its working in web layout.In Print Layput,the header is displayed two times..Plz give me the solution...its very urgent.. strBody =...
0
7056
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
7244
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,...
0
7434
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5542
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4971
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
4652
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3137
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1475
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 ...
1
712
muto222
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.