document.body.style.fontsize is not working

  • Follow


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='green';"

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

Any help is greatly appreciated.

Thanks,
jnag

0
Reply prajyo91 (6) 5/29/2007 8:42:30 PM

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%';}catch(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='green';"
>
> works. I am not able to understand why this is happening.
>
> Any help is greatly appreciated.
>
> Thanks,
> jnag

0
Reply Georgi 5/29/2007 9:00:29 PM


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

0
Reply Pete 5/30/2007 5:23:50 AM

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.

0
Reply jnag 5/31/2007 1:31:28 PM

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.

0
Reply jnag 5/31/2007 1:37:20 PM

4 Replies
718 Views

(page loaded in 0.111 seconds)

Similiar Articles:













7/20/2012 12:12:51 PM


Reply: