kippie
Technical User
- Nov 8, 2001
- 158
In the HTML below I would like to make a hover effect in LinkA of variable text1. I don't know if this is possible or not or that I make a mistake but it doesn't work while LinkB of variable text2 works nicely. Can anyone help?
This is the HTML:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<script language="JavaScript"><!--
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = "25px"
re.innerHTML=message;
re.style.background = "url("+bg+"";
}
var msg1 = 'This is text1 with a <a href="#" class="proef1">Link A</a> '
var msg2 = 'And this is text2 with a <a href="#" >Link B</a>'
// -->
</script>
<style type="text/css"><!--
a.proef1:active { color: khaki; font-size: 10pt; font-family: Arial; text-decoration: none }
a.proef1:hover { color: blue; font-size: 10pt; font-family: Arial; text-decoration: none }
a.proef1:link { color: Cyan; font-size: 10pt; font-family: Arial; text-decoration: none }
a.proef1:visited { color: maroon; font-size: 10pt; font-family: Arial; text-decoration: none }
a:link { color: green; font-size: 10pt; font-family: Arial; text-decoration: none }
a:active { color: Salmon; font-size: 10pt; font-family: Arial; text-decoration: none }
a:visited { color: red; font-size: 10pt; font-family: Arial; text-decoration: none }
a:hover { color: orange; font-size: 10pt; font-family: Arial; text-decoration: none; }
.info { color: #191970; font-size: 10pt; font-family: Arial; text-align: justify }
-->
</style>
</head>
<body>
<table border="2" bordercolor="red" width="250" height="175" cellpadding="0" cellspacing="0">
<tr height="25">
<td id="headmenu" colspan="2" height="25"><a href="#" onclick="htmlChange('textframe',msg1,'bgWhite.gif');">Link1</a> <a href="#" onclick="htmlChange('textframe',msg2,'bgMidnightBlue.gif')">Link2</a></td>
</tr>
<tr height="175">
<td id="textframe" width="200" height="175">
This is text0 with a <a href="#">Link0</a>
</td>
</tr>
</table>
</body>
</html>
Kippie
This is the HTML:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<script language="JavaScript"><!--
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = "25px"
re.innerHTML=message;
re.style.background = "url("+bg+"";
}
var msg1 = 'This is text1 with a <a href="#" class="proef1">Link A</a> '
var msg2 = 'And this is text2 with a <a href="#" >Link B</a>'
// -->
</script>
<style type="text/css"><!--
a.proef1:active { color: khaki; font-size: 10pt; font-family: Arial; text-decoration: none }
a.proef1:hover { color: blue; font-size: 10pt; font-family: Arial; text-decoration: none }
a.proef1:link { color: Cyan; font-size: 10pt; font-family: Arial; text-decoration: none }
a.proef1:visited { color: maroon; font-size: 10pt; font-family: Arial; text-decoration: none }
a:link { color: green; font-size: 10pt; font-family: Arial; text-decoration: none }
a:active { color: Salmon; font-size: 10pt; font-family: Arial; text-decoration: none }
a:visited { color: red; font-size: 10pt; font-family: Arial; text-decoration: none }
a:hover { color: orange; font-size: 10pt; font-family: Arial; text-decoration: none; }
.info { color: #191970; font-size: 10pt; font-family: Arial; text-align: justify }
-->
</style>
</head>
<body>
<table border="2" bordercolor="red" width="250" height="175" cellpadding="0" cellspacing="0">
<tr height="25">
<td id="headmenu" colspan="2" height="25"><a href="#" onclick="htmlChange('textframe',msg1,'bgWhite.gif');">Link1</a> <a href="#" onclick="htmlChange('textframe',msg2,'bgMidnightBlue.gif')">Link2</a></td>
</tr>
<tr height="175">
<td id="textframe" width="200" height="175">
This is text0 with a <a href="#">Link0</a>
</td>
</tr>
</table>
</body>
</html>
Kippie