SheilaAlighieri
Technical User
Hi!
While I was surfing the web I ran into quite an interesting website, namely of Compagnie Financière Richemont S.A. ( The pictures on the welcome page change with each viewing. So does the color of the center table. I know there is some php involved. But I am not sure how it's done exactly. Check this script:
<script type="text/javascript">
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages=new Image()
myimages.src=preloadimages.arguments
}
}
preloadimages("../images/home/copyright_2002_richemont_home<? echo $iRandom ?>_thebrands_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_investorinfo_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_companyprofile_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_careers_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_contact_on.gif","../images/copyright_2002_richemont_arrow_on.gif"
function goUrl(Selected) {
var newURL = Selected.options[Selected.selectedIndex].value ;
if (newURL!=" "
{
document.location.href = newURL;
}
}
</script>
These codes should do it. But I don't know how to come to the side server scripting, which randomly picks certain images and which changes the tablecolor accordingly. Check the site to see what I mean.
I would greatly appreciate all help
I want to use to such a script for a non-commercial website.
Sheila
While I was surfing the web I ran into quite an interesting website, namely of Compagnie Financière Richemont S.A. ( The pictures on the welcome page change with each viewing. So does the color of the center table. I know there is some php involved. But I am not sure how it's done exactly. Check this script:
<script type="text/javascript">
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages=new Image()
myimages.src=preloadimages.arguments
}
}
preloadimages("../images/home/copyright_2002_richemont_home<? echo $iRandom ?>_thebrands_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_investorinfo_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_companyprofile_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_careers_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_contact_on.gif","../images/copyright_2002_richemont_arrow_on.gif"
function goUrl(Selected) {
var newURL = Selected.options[Selected.selectedIndex].value ;
if (newURL!=" "
document.location.href = newURL;
}
}
</script>
These codes should do it. But I don't know how to come to the side server scripting, which randomly picks certain images and which changes the tablecolor accordingly. Check the site to see what I mean.
I would greatly appreciate all help
Sheila