...

View Full Version : [JS] table background change



xtrme
06-24-2009, 09:36 PM
having been searching for quite some time but unfortuantly I can't get my problem resolved

I trying to create a table based photogalley which is really basic
the idea was to have the links in one table and the picture will be displayed as the background of the other table

the code so far is



<html>
<head>
<title>foto</title>

<script language="JavaScript">
var backImage = new Array();
backImage[0] = "TS150U.jpg";
backImage[1] = "TS180U.jpg";
backImage[2] = "";

function changeBGImage(whichImage){
if (document.all){
document.all[photoframe].style.backgroundImage = backImage[whichImage];
}
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table align="center" border="0">
<tr>
<th scope="col"width="138" height="421"> <p><a href="javascript:changeBGImage(0)">Photo 1</a> </br>
<a href="javascript:changeBGImage(1)">photo 2</a></br></p></th>
<th scope="col" bgcolor="#FFFFFF" width="609" height="394" id="photoframe"></th>
/tr>
</table>
</body>
</html>


what am I doing wrong :confused:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum