|
 |
javascript thread: Error in a text menu responding to onclick event.
Message #1 by npandey@h... on Tue, 27 Mar 2001 05:11:02
|
|
My site design consists of top frame and main(bottom) frame. I am trying
to create a navigation menu made of hyperlink texts in the top frame. The
hyperlink text changes font color when onclick event occurs. My problem
is when the user clicks another hyperlink text in the top frame, the
previous hyperlink text should change to its original color and the
clicked hyperlink text should change its font color. This way the users on
the site know where they are on the site.
I tried to wrote the code looking some examples but it doesn't work. I
want the code to work in atleast IE 4.0 browsers. For some reason I do
not want to use images as hyperlink.
<html>
<head>
<title>JC Resorts Navigation</title>
<script language="JavaScript">
<!--
function highlight()
{
var oObj = event.srcElement
oObj.style.color = "#FF00FF" ;
}
function undohighlight()
{
var i
for (i = 0; i < 13; i++) {
if (i.style.color != "#FF00FF")
i.style.color = "F9F193";
}
}
//-->
</script>
<style TYPE="text/css">
<!--
a { color: #F9F193; text-decoration: none; font-family:
Arial; font-size: 10pt }
A:link {color: #F9F193; text-decoration:none}
A:visited {color: #F9F193; text-decoration:none}
A:hover {color: #FF0000;}
-->
</style>
<base target="main">
</head>
<body bgcolor="#FFFFFF" text="FFFFFF" topmargin="0" leftmargin="0"
marginheight="0" marginwidth="0">
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="0" width="100%"
bgcolor="#666633" align="center">
<tr>
<td align="center">
<a href="dataview.asp?prop=surfandsandresort"><DIV id=1
style="color:#F9F193;" onclick="highlight()">Surf and Sand Resort</DIV></a>
</td>
<td align="center">
<a href="dataview.asp?prop=ranchobernardoinn"><DIV id=2
style="color:#F9F193;" onclick="highlight()">Rancho Bernardo Inn</DIV></a>
</td>
<td align="center">
<a href="dataview.asp?prop=temeculacreekinn"><DIV id=3
style="color:#F9F193;" onclick="highlight()">Temecula Creek Inn</DIV></a>
</td>
<td align="center">
<a href="dataview.asp?prop=JCCorporate"><DIV id=4
style="color:#F9F193;" onclick="highlight()">JC Corporate</DIV></a>
</td>
<td align="center">
<a href="jcgolfdataview.asp?event=Golf Promotion"><DIV id=5
style="color:#F9F193;" onclick="highlight()">Golf Promotion</DIV></a>
</td>
<td align="center">
<a href="jcgolfdataview.asp?event=JC Golf"><DIV id=6
style="color:#F9F193;" onclick="highlight()">JC Golf</DIV></a>
</td>
<td align="center">
<a href="xtractlistform.asp"><DIV id=7 style="color:#F9F193;"
onclick="highlight()">Export Data</DIV></a>
</td>
<td align="center">
<a href="logout.asp"><DIV id=8 style="color:#F9F193;"
onclick="highlight()">Logout</DIV></a>
</font>
</td>
</tr>
<tr>
<td align="center">
<a href="send_mass_email.htm"><DIV id=9 style="color:#F9F193;"
onclick="highlight(); undohighlight();">Compose Email</DIV></a>
</td>
<td align="center">
<a href="mailarchives.asp"><DIV id=10 style="color:#F9F193;"
onclick="highlight(); undohighlight();">Mail Archives </DIV></a>
</td>
<td align="center">
<a href="counter.asp"><DIV id=11 style="color:#F9F193;"
onclick="highlight(); undohighlight();">Counter</DIV></a>
</td>
<td align="center">
<a href="invalidemails.asp"><DIV id=12 style="color:#F9F193;"
onclick="highlight(); undohighlight();">Invalid Emails</DIV></a>
</td>
<td align="center">
<a href="remove_email.asp"><DIV id=13 style="color:#F9F193;"
onclick="highlight(); undohighlight();">Remove Invalid Emails</DIV></a
</td>
<td align="center">
</td>
<td align="center">
</td>
<td align="center">
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
I need JavaScript Guru's help to make this code work.
Thanks in advance for your help.
NP
|
|
 |