CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
dynamic font size in HTML CSS?

 



sturno
Deleted

Jan 26, 2001, 2:26 PM

Post #1 of 4 (223 views)
dynamic font size in HTML CSS? Can't Post

I want to get rid of the JavaScript which sets my BODY font size in my HTML and CSS. I want to do it from Perl/CGI instead. Netscape 6 doesn't obey is why. Here is the JavaScript which used to work with Netscape 4.7 and MSIE 5.


<SCRIPT LANGUAGE="JavaScript">
-- Begin
var name = navigator.appName
var version = (parseInt(navigator.appVersion))
var charScale = parseInt(screen.height / 35)
if
( name == "Netscape" && version >= 4 )
{
document.tags.body.fontSize = charScale
}
else
{
function format()
{ var charScale = parseInt(screen.height / 35);
if (document.all)
{ var allBodies = document.all.tags("BODY");
for ( var i = 0; i < allBodies.length; i++ )
{ allBodies.style.fontSize = charScale;
}
var allBs = document.all.tags("B");
for ( var i = 0; i < allBs.length; i++ )
{ allBs.style.color = "#000080"
}
}
else if(document.tags)
{ document.tags.body.fontSize = charScale;
}
}
}
// End --
</SCRIPT>

The key word up there was charScale.
See this script in action at

http://om-ah-hum.com

don't go there with Netscape 6.

I think that all I need to know is how to querry the Browser's screen height from CGI. I can handle it from there. Thanks loads.

It's nice to be important...
but it's more important to be nice.


modified
Deleted

Jan 26, 2001, 5:58 PM

Post #2 of 4 (222 views)
Re: dynamic font size in HTML CSS? [In reply to] Can't Post

What exactly are you trying to do? Create a Perl script that would be the equivalent of that JavaScript thing?



sturno
Deleted

Jan 28, 2001, 7:08 AM

Post #3 of 4 (218 views)
Re: dynamic font size in HTML CSS? [In reply to] Can't Post

Yes. I want to ashcan the browser-dependent JavaScript and redo the trick in Perl. I need only learn how to make the browser tell Perl what is the screen height, or width, in pixels of the current screen. Couldn't find that in a book. That's all I need, how to get that data out of the browser and into Perl. The rest is easy.

It's nice to be important...
but it's more important to be nice.


modified
Deleted

Jan 28, 2001, 9:24 AM

Post #4 of 4 (216 views)
Re: dynamic font size in HTML CSS? [In reply to] Can't Post

I doubt that's possible. Perl is a server-side thing.


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives