kippie
Technical User
- Nov 8, 2001
- 158
I have a HTML (see below) with functions to swap images in one table cell (imageframe) and texts into another cell (textframe). I set a background-image (backimg.jpg) in the textframe. How can I change this backimg.jpg with CSS?
Kippie
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<script language="JavaScript" name="WZW"><!--
//These are the images to appear in the image frame
alt1 = new Image();
alt1.src = "img1.jpg";
alt2 = new Image();
alt2.src = "img2.jpg";
// -->
</script>
<script language="JavaScript" name="CQ"><!--
//These are the texts to appear in the textframe
var msg1 = 'This is Message 1'
var msg2 = 'And this is Message2'
//This is the functions to change text:
function htmlChange(id,message){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.innerHTML=message;
}
//This is the function to change an image
function rewriteImg(id,imgName){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.innerHTML="<img src='"+eval(imgName + ".src"
+"'>";
}
//this is a function not used in this html
function changeImg(id,imgName){
document.images[id].src=eval(imgName+".src"
;
}
// -->
</script>
</head>
<body>
<table name="bigtable" border="1" width="570" height="357" cellpadding="0" cellspacing="0">
<tr height="14">
<td id="headmenu" colspan="2" height="14">
<a href="/" onmouseover="htmlChange('textframe',msg1);
rewriteImg('imageframe','alt1');">Choice1</a>
<a href="/" onmouseover="htmlChange('textframe',msg2);
rewriteImg('imageframe','alt2');">Choice2</a>
</td>
</tr>
<tr height="301">
<td id="imageframe" width="226" height="301">
<img src="img0.jpg" height="301">
</td>
<td id="cell for texttable" valign="middle" height="301">
<table border="3" cellpadding="15" width="344" height="100%">
<tr>
<td id="textframe" background-image="backimg.jpg">Starting Text</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Kippie
Kippie
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<script language="JavaScript" name="WZW"><!--
//These are the images to appear in the image frame
alt1 = new Image();
alt1.src = "img1.jpg";
alt2 = new Image();
alt2.src = "img2.jpg";
// -->
</script>
<script language="JavaScript" name="CQ"><!--
//These are the texts to appear in the textframe
var msg1 = 'This is Message 1'
var msg2 = 'And this is Message2'
//This is the functions to change text:
function htmlChange(id,message){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.innerHTML=message;
}
//This is the function to change an image
function rewriteImg(id,imgName){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.innerHTML="<img src='"+eval(imgName + ".src"
}
//this is a function not used in this html
function changeImg(id,imgName){
document.images[id].src=eval(imgName+".src"
}
// -->
</script>
</head>
<body>
<table name="bigtable" border="1" width="570" height="357" cellpadding="0" cellspacing="0">
<tr height="14">
<td id="headmenu" colspan="2" height="14">
<a href="/" onmouseover="htmlChange('textframe',msg1);
rewriteImg('imageframe','alt1');">Choice1</a>
<a href="/" onmouseover="htmlChange('textframe',msg2);
rewriteImg('imageframe','alt2');">Choice2</a>
</td>
</tr>
<tr height="301">
<td id="imageframe" width="226" height="301">
<img src="img0.jpg" height="301">
</td>
<td id="cell for texttable" valign="middle" height="301">
<table border="3" cellpadding="15" width="344" height="100%">
<tr>
<td id="textframe" background-image="backimg.jpg">Starting Text</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Kippie