Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get this hover effect working?

Status
Not open for further replies.

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=&quot;content-type&quot; content=&quot;text/html;charset=iso-8859-1&quot;>
<meta name=&quot;generator&quot; content=&quot;Adobe GoLive 4&quot;>
<script language=&quot;JavaScript&quot;><!--
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = &quot;25px&quot;
re.innerHTML=message;
re.style.background = &quot;url(&quot;+bg+&quot;)&quot;;
}

var msg1 = 'This is text1 with a <a href=&quot;#&quot; class=&quot;proef1&quot;>Link A</a> '
var msg2 = 'And this is text2 with a <a href=&quot;#&quot; >Link B</a>'
// -->
</script>

<style type=&quot;text/css&quot;><!--
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=&quot;2&quot; bordercolor=&quot;red&quot; width=&quot;250&quot; height=&quot;175&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr height=&quot;25&quot;>
<td id=&quot;headmenu&quot; colspan=&quot;2&quot; height=&quot;25&quot;><a href=&quot;#&quot; onclick=&quot;htmlChange('textframe',msg1,'bgWhite.gif');&quot;>Link1</a> <a href=&quot;#&quot; onclick=&quot;htmlChange('textframe',msg2,'bgMidnightBlue.gif')&quot;>Link2</a></td>
</tr>
<tr height=&quot;175&quot;>
<td id=&quot;textframe&quot; width=&quot;200&quot; height=&quot;175&quot;>
This is text0 with a <a href=&quot;#&quot;>Link0</a>
</td>
</tr>
</table>
</body>
</html>

Kippie
 
Yes, that works. Thanks
Kippie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top