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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Mouseover

Status
Not open for further replies.

karlad

Programmer
Oct 19, 2007
3
CA
I'm trying to get the 'profile', 'credits' etc buttons to change color on mouseover with javascript.

Not sure what I'm doing wrong?

Thanks In Advance!
 
Use Firefox to view the page, and look at the error console to get some ideas of the problems on your page.

Lee
 
I didn't see any error console.

Below is my script.



</head>
<script LANGUAGE="JavaScript">



<!--



if (document.images) {



img1on = new Image(); // On Images



img1on.src = "


img2on = new Image();



img2on.src = "


img3on = new Image();



img3on.src = "h


img4on = new Image();



img4on.src = "


img5on = new Image();



img5on.src = "


img6on = new Image();



img6on.src = "


img1off = new Image(); // Off Images



img1off.src = "


img2off = new Image();



img2off.src = "


img3off = new Image();



img3off.src = "


img4off = new Image();



img4off.src = "


img5off = new Image();



img5off.src = "


img6off = new Image();



img6off.src = "


}



function imgOn(imgName) { if (document.images) {



document
.src = eval(imgName + "on.src");







}}



function imgOff(imgName) { if (document.images) {



document
.src = eval(imgName + "off.src");



}}



//-->





</script>

<body bgcolor=#000000 background=images/dark.jpg>
<div align=center>
<center>
<table border=0 width=795 height=595 bgcolor=#000000 cellpadding=0 cellspacing=0>
<tr>
<td width=795 valign=middle align=center height="84" colspan="7">

<div align=center>
<table border=0 width=795 cellspacing="0" cellpadding="0" height="84">
<tr>
<td width=50%><img border="0" src="images/homeadren1.jpg" width="249" height="84"></td>
<td width=50%><img border="0" src="images/homeadren2.jpg" width="546" height="84"></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width=795 valign=middle align=center height="147" colspan="7">
<div align=center>
<table border=0 width=795 cellspacing="0" cellpadding="0" height="147">
<tr>
<td width=249 height="147"><img border="0" src="images/homefilmstrip1.jpg" width="249" height="147"></td>
<td width=177 height="147"><img border="0" src="images/homefilmstrip2.jpg" width="177" height="147"></td>

<td width=120 height="147"><img border="0" src="images/homefilmstrip3.jpg" width="120" height="147"></td>
<td width=117% height="147"><img border="0" src="images/homefilmstrip4.jpg" width="117" height="147"></td>
<td width=20%><img border="0" src="images/homefilmstrip5.jpg" width="132" height="147"></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width=249 valign=middle align=center height="27">
<img border="0" src="images/homewords1.jpg" width="249" height="27"> </td>
<td width=103 valign=middle align=center height="27">
<a href="profile.htm" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')" ><img NAME='img1' border="0" src="images/profile.jpg" width="103" height="27"></a></td>
<td width=90 valign=middle align=center height="27">

<a href="credits.htm" onMouseOut="imgOff('img2')" onMouseOver="imgOn('img2')" ><img NAME='img1' border="0" src="images/credits.jpg" width="90" height="27"> </a> </td>
<td width=66 valign=middle align=center height="27">
<a href="news.htm" onMouseOut="imgOff('img3')" onMouseOver="imgOn('img3')" ><img NAME='img1' border="0" src="images/news.jpg" width="66" height="27"> </a> </td>
<td width=91 valign=middle align=center height="27">
<a href="photos.htm" onMouseOut="imgOff('img4')" onMouseOver="imgOn('img4')" ><img NAME='img1' border="0" src="images/photos.jpg" width="91" height="27"> </a> </td>
<td width=104 valign=middle align=center height="27">
<a href="contact.htm" onMouseOut="imgOff('img5')" onMouseOver="imgOn('img5')" ><img NAME='img1' border="0" src="images/contact.jpg" width="104" height="27"> </a> </td>
<td width=92 valign=middle align=center height="27">

<a href="links.htm" onMouseOut="imgOff('img6')" onMouseOver="imgOn('img6')" ><img NAME='img1' border="0" src="images/links.jpg" width="92" height="27"> </a> </td>
</tr>
<tr>
<td width=795 valign=middle align=center colspan="7" height="297">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top