Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / May 2007



Tip: Looking for answers? Try searching our database.

document.body.style.fontsize is not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jnag - 29 May 2007 21:42 GMT
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
Georgi Naumov - 29 May 2007 22:00 GMT
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,
>
[quoted text clipped - 14 lines]
> Thanks,
> jnag
Pete - 30 May 2007 06:23 GMT
> 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?
jnag - 31 May 2007 14:31 GMT
> > onclick="document.body.style.fontSize='50%';"
>
[quoted text clipped - 6 lines]
>
> 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.
jnag - 31 May 2007 14:37 GMT
> > onclick="document.body.style.fontSize='50%';"
>
[quoted text clipped - 6 lines]
>
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.