joomlaexpert.com
 
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 (3)add
Interesting : Guest
THis is an interesting snippent. I will use it in my personal site, launchign next year (in 3 weeks from now). 8)

Nice.
December 22, 2005
fxrh : saht
men shox shoes
cheap shox nz shoes
men's nike shox shoes
nike shox nz shoes
April 29, 2010
... : ghj
cheap nike shox r4
fendi sandals
women shox shoes
cheap nike shox nz
April 29, 2010
Write comment


Write the displayed characters


busy
 
Home