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

document.body.style.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="document.body.style.fontSize='50%';"

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

onclick="document.body.style.backgroundColor='gree n';"

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

Any help is greatly appreciated.

Thanks,
jnag

May 29 '07 #1
4 22041
This code working for me.
onclick="document.body.style.fontSize='50%';"
(FF2 and IE6) . You can try something like this:
onclick="try{document.body.style.fontSize='50%';}c atch(ex)
{alert(ex.message);}"
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="document.body.style.fontSize='50%';"

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

onclick="document.body.style.backgroundColor='gree n';"

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

Any help is greatly appreciated.

Thanks,
jnag
May 29 '07 #2
>
onclick="document.body.style.fontSize='50%';"

This does not work at all for some reason. Whereas,
<a href="#" onclick="document.body.style.fontSize='50%';return
false;">link</a>

this works fine.

how are you calling onclick?

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

<a href="#" onclick="document.body.style.fontSize='50%';return
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...@gmail.comwrote:
onclick="document.body.style.fontSize='50%';"
This does not work at all for some reason. Whereas,

<a href="#" onclick="document.body.style.fontSize='50%';return
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
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...
2
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...
3
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...
4
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,...
4
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...
10
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');...
3
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...
4
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
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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
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,...
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...
0
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...

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.