473,770 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.body.s tyle.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.s tyle.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="baselin e"><a href="#" onclick="(docum ent.body.style. zoom)?
document.body.s tyle.zoom/=1.2:document.b ody.style.zoom= 1/1.2">A-
&nbsp;</a></td>

<td valign="baselin e"><a href="#"
onclick="docume nt.body.style.z oom=1">A&nbsp;</a></td>

<td valign="baselin e"><a href="#" onclick="(docum ent.body.style. zoom)?
document.body.s tyle.zoom*=1.2: document.body.s tyle.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 15596
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.s tyle.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...@g mail.comwrote:
On Jun 1, 11:50 am,jnag<prajy.. .@gmail.comwrot e:
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.s tyle.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...@g mail.comwrote:
On Jun 1, 11:50 am,jnag<prajy.. .@gmail.comwrot e:
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.s tyle.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
9649
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 assigned to a variable and output using document.write. (Note, there is no submit button or other form elements. Basically
2
2231
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 editing in the browser. Need the ".DOC" standard so no conversion will have to take place when saving or retrieving this to or from the server. TIA -
10
2853
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) By following this way, the whole HTML page will be zoomed BUT in a PROPORTIONAL way.
0
1648
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 can see the text in my string builder variable, but once the page opens as a Word document, that same text is not showing. It seems to only be text that I am displaying as a result of some checkboxes I am trying to write to the page. Can anyone...
6
7238
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 display an image. document.images only seems to reference image tags. The collection needs to include background images, input type = image, image maps, css assigned background, etc. Honestly, I am probably not aware of all the possibilities...
5
3416
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 with moderate success using Saxon and <xsl:result-document>, but Saxon is throwing an error and I don't know how to resolve it. Maybe someone can offer some advice? This is a long question, for which I apologise... OS= Windows XP Pro, Saxon=8.8 XML...
0
2542
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 footer in word along with the page number. i got the code for generating tables and it is fine now i am trying for header and footer but i am failing here. i am sending my code , just check it. StringBuilder sbTop = new StringBuilder();
4
2645
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 iframe's src property. Being that IE does not follow standard and considers an id, name, etc as a qualifying identifier for the document.getElementById object, I double checked to make sure that there's only one instance of id = "servif" and I never use...
0
2216
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 = "<html xmlns:o='urn:schemas-microsoft-com:office:office' " & _ "xmlns:w='urn:schemas-microsoft-com:office:word'" & _ "xmlns='http://www.w3.org/TR/REC-html40'>" strBody = strBody + "<!-->" & _ "<xml>" & _ "<w:WordDocument>" & _
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9869
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8883
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
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 we have to send another system

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.