Warning: Be careful, each browser on each platform reacts differently to
those instructions and tests are required to make sure that your Javascript will
behave as expected. Even the browser detection scripts on website such as
Javascript.com cannot be considered as working correctly in all situations.
those instructions and tests are required to make sure that your Javascript will
behave as expected. Even the browser detection scripts on website such as
Javascript.com cannot be considered as working correctly in all situations.
An easy way to make the
recall the index file with some parameters. This is almost invisible for the
visitor but do not forget to include a
(initialised to
index file is replaced and replaced again. As soon as the parameter (here
platform) is detected, the
The
variable
to the stylesheet. You can test it using a
block and, in our example, increase the font size by 2 in case a Mac based
platform is detected (extracted from
$platform
variable to the PHP code is torecall the index file with some parameters. This is almost invisible for the
visitor but do not forget to include a
$detect
variable(initialised to
true
if not set) to avoid to enter a loop where theindex file is replaced and replaced again. As soon as the parameter (here
platform) is detected, the
$detect
variable is set to false.The
variable
$platform
is now available to the index file and thereforeto the stylesheet. You can test it using a
switch() { case: ; }
block and, in our example, increase the font size by 2 in case a Mac based
platform is detected (extracted from
stylesheet.css.php
):
<?php
body, h1, h2, h3, h4, h5, h6, p {
font-size:<?php
switch($platform) {
case 'mac';
print($VISUALS[$SkinID]['page']['fontsize'] + 2;
break;
default:
print($VISUALS[$SkinID]['page']['fontsize'];
break;
}
print( $VISUALS[$SkinID]['page']['fontunit'] ); ?>;
?>;
}
?>
The value of this increment should depend on the font unit that you use (px,
pt, em, etc.). This increment could also be declared as a new visual parameter
to be included in your visual configuration file as:
pt, em, etc.). This increment could also be declared as a new visual parameter
to be included in your visual configuration file as:
<?php
$VISUALS[0]['page']['fontsize']['increment']
?>
(extracted from
visuals.inc
).