473,404 Members | 2,179 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,404 software developers and data experts.

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 15561
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
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
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
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
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
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
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
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
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
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 =...
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
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
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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...

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.