|
Yes, we have changed the template... (8182 hits) |
Written by Thomas Kahl
You are on the right website! We have created a new template for our site. We hope you like it. We have also added some nice little tricks. Nothing big - but one thing might be interesting for you. When you skip through the site, you might recognize the header-picture is always a bit different and changing. Wrong. Not the picture is changing...
It's only the frame you see. The picture for the header is much bigger than the visible part. In the template is a little php-code, that does the whole trick:
<?
$xrange=600;
$yrange=300;
$headx=-rand(0,$xrange);
$heady=-rand(0,$yrange);
?>
<tr style="background: url(/templates/je/images/je_head.jpg)
<? echo $headx."px ".$heady."px"; ?>
no-repeat;width:800px;height:150px;">
$xrange and $yrange is the difference in pixels between the x and y size of the picture and the size of the visible area. These values mark the maximum of the random numbers that are calculated. The (negative) values set the top and left position of the background image. So the visible image is always different - without loading another image.
Comments () |
|
|
|
|
|