dcdemon813
05-08-2008, 08:11 AM
Im making a modeling website for my friend. I would like to display an image on the homepage as a background... I just would like to do multiple. every time a visitor comes to the page, i would like to have a different background image appear. I did find the code in this forum here: http://www.codingforums.com/showthread.php?t=59581
But here is my dilemma. I havent produced any kind of webpage in a couple years and i am a bit rusty...
I did find a PHP code that milla jonovichs website using very well. Im using Adobe golive, photoshop, and dreamweaver. (golive and dreamweaver have things that are easier for me to use.) the PHP code doesnt do anything... it doesnt produce errors... just doesnt produce anything. and the javascript... does work. I believe the reason is user error.. lol. Can anyone help me out?
here is my codeing:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>Mywebsite</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="#b5bcc5" onLoad="MM_preloadImages('images/BioBUTTONup.png','images/GalleryBUTTONup.png','images/ContactBUTTONup.png')">
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center" background=":mad:" cool gridx="10" gridy="10" height="534" showgridx showgridy usegridx usegridy>
<tr height="10">
<td width="799" height="10" colspan="5"></td>
<td width="1" height="10"><spacer type="block" width="1" height="10"></td>
</tr>
<tr height="22">
<td width="10" height="523" rowspan="2"></td>
<td width="390" height="523" rowspan="2" valign="top" align="left" xpos="10"><img src="images/HomebuttonUP.png" alt="" height="65" width="260" border="0"></td>
<td width="399" height="22" colspan="3"></td>
<td width="1" height="22"><spacer type="block" width="1" height="22"></td>
</tr>
<tr height="501">
<td width="144" height="501" valign="top" align="left" xpos="400"><a href="biography.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Biography','','images/BioBUTTONup.png',1)"><img src="images/BioBUTTON.png" name="Biography" width="110" height="35" border="0"></a></td>
<td width="112" height="501" valign="top" align="left" xpos="544"><a href="gallery.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gallery','','images/GalleryBUTTONup.png',1)"><img src="images/GalleryBUTTON.png" name="Gallery" width="80" height="35" border="0"></a></td>
<td width="143" height="501" valign="top" align="left" xpos="656"><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Contact','','images/ContactBUTTONup.png',1)"><img src="images/ContactBUTTON.png" name="Contact" width="80" height="35" border="0"></a></td>
<td width="1" height="501"><spacer type="block" width="1" height="501"></td>
</tr>
<tr height="1" cntrlrow>
<td width="10" height="1"><spacer type="block" width="10" height="1"></td>
<td width="390" height="1"><spacer type="block" width="390" height="1"></td>
<td width="144" height="1"><spacer type="block" width="144" height="1"></td>
<td width="112" height="1"><spacer type="block" width="112" height="1"></td>
<td width="143" height="1"><spacer type="block" width="143" height="1"></td>
<td width="1" height="1"></td>
</tr>
</table>
<p></p>
</body>
</html>
i did place a mad face where i link a single picture... any ideas? please?!?
i am also aware i asked in the HTML n CSS part, but im hoping there may be HTML code for what i want to achieve?
But here is my dilemma. I havent produced any kind of webpage in a couple years and i am a bit rusty...
I did find a PHP code that milla jonovichs website using very well. Im using Adobe golive, photoshop, and dreamweaver. (golive and dreamweaver have things that are easier for me to use.) the PHP code doesnt do anything... it doesnt produce errors... just doesnt produce anything. and the javascript... does work. I believe the reason is user error.. lol. Can anyone help me out?
here is my codeing:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>Mywebsite</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="#b5bcc5" onLoad="MM_preloadImages('images/BioBUTTONup.png','images/GalleryBUTTONup.png','images/ContactBUTTONup.png')">
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center" background=":mad:" cool gridx="10" gridy="10" height="534" showgridx showgridy usegridx usegridy>
<tr height="10">
<td width="799" height="10" colspan="5"></td>
<td width="1" height="10"><spacer type="block" width="1" height="10"></td>
</tr>
<tr height="22">
<td width="10" height="523" rowspan="2"></td>
<td width="390" height="523" rowspan="2" valign="top" align="left" xpos="10"><img src="images/HomebuttonUP.png" alt="" height="65" width="260" border="0"></td>
<td width="399" height="22" colspan="3"></td>
<td width="1" height="22"><spacer type="block" width="1" height="22"></td>
</tr>
<tr height="501">
<td width="144" height="501" valign="top" align="left" xpos="400"><a href="biography.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Biography','','images/BioBUTTONup.png',1)"><img src="images/BioBUTTON.png" name="Biography" width="110" height="35" border="0"></a></td>
<td width="112" height="501" valign="top" align="left" xpos="544"><a href="gallery.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Gallery','','images/GalleryBUTTONup.png',1)"><img src="images/GalleryBUTTON.png" name="Gallery" width="80" height="35" border="0"></a></td>
<td width="143" height="501" valign="top" align="left" xpos="656"><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Contact','','images/ContactBUTTONup.png',1)"><img src="images/ContactBUTTON.png" name="Contact" width="80" height="35" border="0"></a></td>
<td width="1" height="501"><spacer type="block" width="1" height="501"></td>
</tr>
<tr height="1" cntrlrow>
<td width="10" height="1"><spacer type="block" width="10" height="1"></td>
<td width="390" height="1"><spacer type="block" width="390" height="1"></td>
<td width="144" height="1"><spacer type="block" width="144" height="1"></td>
<td width="112" height="1"><spacer type="block" width="112" height="1"></td>
<td width="143" height="1"><spacer type="block" width="143" height="1"></td>
<td width="1" height="1"></td>
</tr>
</table>
<p></p>
</body>
</html>
i did place a mad face where i link a single picture... any ideas? please?!?
i am also aware i asked in the HTML n CSS part, but im hoping there may be HTML code for what i want to achieve?