News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

JavaScript - font size bigger

Started by Owdy, August 07, 2004, 01:53:16 PM

Previous topic - Next topic

Owdy

How can i make font size bigger with javascript?
Example: www.tehy.fi ->  'Pienennä tekstiä'   'Suurenna tekstiä'
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

[Unknown]

Quote from: Owdy on August 07, 2004, 01:53:16 PM
How can i make font size bigger with javascript?
Example: www.tehy.fi ->  'Pienennä tekstiä'   'Suurenna tekstiä'


They're cheating.

Anyhow, what you could do is do what they are.  Cheaters.  Anyhow, they just set a cookie, and then reload the page - then, their css checks that cookie, and adjusts the font size as such...

For example, you could check if the cookie is set and if so, do this:
*
{
   font-size: larger;
}

Or, you could make the style.css file style.css.php, and then make it:
<?php
header('Content-Type: text/css');
$fontsize = isset($_COOKIE['largerfont']) ? 12 : 10;
?>

And then replace all the font-size: parts with something like:
font-size: <?php echo $fontsize + 2; ?>pt; /* Normally 12pt */
...
font-size: <?php echo $fontsize - 2; ?>pt; /* Normally 8pt */

-[Unknown]

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Advertisement: