Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > document.body.style.fontsize is not working

Reply
Thread Tools

document.body.style.fontsize is not working

 
 
jnag
Guest
Posts: n/a
 
      05-29-2007
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

 
Reply With Quote
 
 
 
 
Georgi Naumov
Guest
Posts: n/a
 
      05-29-2007
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


 
Reply With Quote
 
 
 
 
Pete
Guest
Posts: n/a
 
      05-30-2007

>
> 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?

 
Reply With Quote
 
jnag
Guest
Posts: n/a
 
      05-31-2007
On May 30, 1:23 am, Pete <peter.gal...@gmail.com> wrote:
> > 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 <body> of 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.

 
Reply With Quote
 
jnag
Guest
Posts: n/a
 
      05-31-2007
On May 30, 1:23 am, Pete <peter.gal...@gmail.com> wrote:
> > 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect is not working but server.transfer is working gaurav tyagi ASP .Net 14 01-20-2006 04:22 AM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
ASP.NET client-side validation working, but button click not working Alan Silver ASP .Net 1 08-02-2005 03:50 PM
Cookies working on intranet but NOT working on Internet Martin Heuckeroth ASP .Net 5 04-01-2005 01:37 AM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM



Advertisments