Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-24-2009, 08:36 PM   PM User | #1
xtrme
New to the CF scene

 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
xtrme is an unknown quantity at this point
Cool [JS] table background change

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

Code:
<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
xtrme is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:22 AM.


Advertisement
Log in to turn off these ads.