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

Home Posts Topics Members FAQ

document.body.s tyle.fontsize is not working

Hello,

Through an onClick() event, I have an inline function to change the
font size of the page (actually, I need to do this for the entire
website). I have this defined in the header.cfm file as:

onclick="docume nt.body.style.f ontSize='50%';"

This does not work at all for some reason. Whereas,

onclick="docume nt.body.style.b ackgroundColor= 'green';"

works. I am not able to understand why this is happening.

Any help is greatly appreciated.

Thanks,
jnag

May 29 '07 #1
4 22081
This code working for me.
onclick="docume nt.body.style.f ontSize='50%';"
(FF2 and IE6) . You can try something like this:
onclick="try{do cument.body.sty le.fontSize='50 %';}catch(ex)
{alert(ex.messa ge);}"
To see what is problem.

jnag :
Hello,

Through an onClick() event, I have an inline function to change the
font size of the page (actually, I need to do this for the entire
website). I have this defined in the header.cfm file as:

onclick="docume nt.body.style.f ontSize='50%';"

This does not work at all for some reason. Whereas,

onclick="docume nt.body.style.b ackgroundColor= 'green';"

works. I am not able to understand why this is happening.

Any help is greatly appreciated.

Thanks,
jnag
May 29 '07 #2
>
onclick="docume nt.body.style.f ontSize='50%';"

This does not work at all for some reason. Whereas,
<a href="#" onclick="docume nt.body.style.f ontSize='50%';r eturn
false;">link</a>

this works fine.

how are you calling onclick?

May 30 '07 #3
On May 30, 1:23 am, Pete <peter.gal...@g mail.comwrote:
onclick="docume nt.body.style.f ontSize='50%';"
This does not work at all for some reason. Whereas,

<a href="#" onclick="docume nt.body.style.f ontSize='50%';r eturn
false;">link</a>

this works fine.

how are you calling onclick?
I am calling onclick in a header.cfm file. And, I want to change the
font of the <bodyof the content pages which are outside the header/
banner. The error message I am getting says that it cannot find the
object to change font.

May 31 '07 #4
On May 30, 1:23 am, Pete <peter.gal...@g mail.comwrote:
onclick="docume nt.body.style.f ontSize='50%';"
This does not work at all for some reason. Whereas,

<a href="#" onclick="docume nt.body.style.f ontSize='50%';r eturn
false;">link</a>

this works fine.

how are you calling onclick?
Actually, now I am not getting any error message. But, the fontSize
does not change either upong clicking the link/button in the banner.

May 31 '07 #5

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

Similar topics

1
1765
by: Stefano Bocconi | last post by:
Hi all, I am trying to use javascript to generate a SMIL document to give as input to the browser (in another window or in the same). I tried this: <HTML> <HEAD> <TITLE>My First JavaScript</TITLE> </HEAD> <BODY>
2
20948
by: Gary Mayor | last post by:
Hi, I'm back again. Basically i'm trying to draw a box over an image which is turning out to be a nightmare. The problem i'm getting at the moment is that i'm creating a line with <div which works when it's not hidden but I need to be able to make it hidden so I can use layers to show all when it finished drawing to make it smoother. This is how some other scripts are doing it that i've seen. So i've got it drawing a line and I need...
3
5720
by: Gary Mayor | last post by:
Hi, I'm re phrasing and earlier question as the earlier question doesn't make to much sense. I using document.onmousemove to move a <div line on the screen. At the moment if I click and move the mouse over the image it doesn't move the line but if I click off the image and move the mouse the line moves like it's supposed to. Also if I click it off the image and move the mouse over the image it then works. Something on clicking the image...
4
2952
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400, like DOS, uses memory-mapped display, two bytes per character (one char byte and one attribute byte). We can get the screen offset allright, and I've written a javascript which does the math to convert the offset into row/col (i.e. left, top)...
4
1756
by: Eduard Witteveen | last post by:
Hello, I want to make a hooverbox, which is shown when the mousepointer is not moved for a amount of time. When the hooverbox is shown, i will do a server request to retrieve the information for the hooverbox. I was thinking of using document.onmousemove and a infinit running while loop comparing the mouse positions. Is this the way to solve it?
10
4279
by: webEater | last post by:
Hello, I try the following in Firefox and other modern browsers: window.addEventListener('load', function() { document.title = CSS.getClass('fontSize'); var div = document.createElement('div'); document.getElementsByTagName('body').appendChild(div); alert(div); alert(div.style) }, true);
3
15596
by: jnag | last post by:
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)?...
4
13472
by: kiransasi | last post by:
hi all, i m herewith struck with this problem.... check out the following code and lemme know the solution for this.... <html> <heAD> <TITLE>WAIT</TITLE>
10
1754
omerbutt
by: omerbutt | last post by:
hi there i am working on an inventory rpoject and for that i have made a stock entry form which is pasted below,I have included this form in the main Add Stock page, having the following inputs to be saved 1.code no 2part no 3total replace no's--------->this is wot the ques is about 4auto 5type 6brand 7height 8product 9outer dia 1
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
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...
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
5312
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.