by jbunnell on Sat Apr 12, 2008 1:51 am
This is 'jsFunction.js':
<!-------The functions showMenu() and removeMenu() are used to display the pop-up menus on the navigation bar----------->
var menus = new Array(3);
menus = ["maintenance", "rudiments", "percussion"];
function showMenu(id){
clearMenus();
document.getElementById(id).style.zIndex="1";
}
function removeMenu(id){
document.getElementById(id).style.zIndex="-1";
}
function clearMenus(){
for(var i=0; i<menus.length; i++){
var menu = document.getElementById(menus[i]);
if(menu.style.zIndex=="1"){
removeMenu(menus[i]);
}
}
}
<!-----underline() and removeUnderline() are used to display the rollover on the navigation bar----------->
function underline(id){
document.getElementById(id).style.textDecoration="underline";
}
function removeUnderline(id){
document.getElementById(id).style.textDecoration="none";
}
<!------highlight() and unhighlight() are used to display the rollover on the pop-up menus-------------->
function highlight(cellId, fontId){
document.getElementById(cellId).style.backgroundColor="#ffff99";
document.getElementById(fontId).style.color="black";
}
function unhighlight(cellId, fontId){
document.getElementById(cellId).style.backgroundColor="green";
document.getElementById(fontId).style.color="#ffff99";
}
Here is my html document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link href="styles.css" rel="stylesheet" type="text/css">
<script src="jsFunctions.js" language="javascript" type="text/javascript"></script>
</head>
<body>
<!----------Body which contains the content of the page--------------->
<div id="content" class="content" onmousedown="clearMenus();" onmouseup="clearMenus();">
<h1>Choosing Your Drum Kit</h1>
</div>
<!-----Menu for Tuning & Maintenance--------------------->
<div id="maintenance" class="maintenance">
<table align="left" border="0" cellpadding="2" cellspacing="1" bgcolor="green">
<tr><td id="m1" onmouseover="highlight('m1', 'mf1');" onmouseout="unhighlight('m1', 'mf1');">
<a href=""><font id="mf1">tuning</font></a></td>
</tr>
<tr><td id="m2" onmouseover="highlight('m2', 'mf2');" onmouseout="unhighlight('m2', 'mf2');">
<a href=""><font id="mf2">set up your kit</font></a></td>
</tr>
<tr><td id="m3" onmouseover="highlight('m3', 'mf3');" onmouseout="unhighlight('m3', 'mf3');">
<a href=""><font id="mf3">prepare</font></a></td>
</tr>
<tr>
<td height="85"></td>
</tr>
</table>
</div>
<!-------Menu for Rudiments & Drum Beats----------------->
<div id="rudiments" class="rudiments">
<table align="left" border="0" cellpadding="2" cellspacing="1" bgcolor="green">
<tr>
<td id="r1" onmouseover="highlight('r1', 'rf1');" onmouseout="unhighlight('r1', 'rf1');">
<a href=""><font id="rf1">Advanced</font></a>
</td>
</tr>
<tr>
<td id="r2" onmouseover="highlight('r2', 'rf2');" onmouseout="unhighlight('r2', 'rf2');">
<a href=""><font id="rf2">Intermediate</font></a>
</td>
</tr>
<tr>
<td id="r3" onmouseover="highlight('r3', 'rf3');" onmouseout="unhighlight('r3', 'rf3');">
<a href=""><font id="rf3">Beginner</font></a>
</td>
</tr>
<tr>
<td height="85"></td>
</tr>
</table>
</div>
<!------------Menu for Auxiliary Percussion----------------------->
<div id="percussion" class="percussion">
<table align="left" border="0" cellpadding="2" cellspacing="1" bgcolor="green">
<tr>
<td id="p1" onmouseover="highlight('p1', 'pf1');" onmouseout="unhighlight('p1', 'pf1');">
<a href="aux/bells.html"><font id="pf1">bells & xylos</font></a>
</td>
</tr>
<tr>
<td id="p2" onmouseover="highlight('p2', 'pf2');" onmouseout="unhighlight('p2', 'pf2');">
<a href="aux/concertstuff.html"><font id="pf2">concert stuff</font></a>
</td>
</tr>
<tr>
<td id="p3" onmouseover="highlight('p3', 'pf3');" onmouseout="unhighlight('p3', 'pf3');">
<a href="aux/beginner.html"><font id="pf3">Beginner</font></a>
</td>
</tr>
<tr>
<td height="85"></td>
</tr>
</table>
</div>
<!-------------Footer which contains the Navigation Bar--------------->
<div class="foot">
<hr>
<table width="700">
<tr align="center">
<td><a href="choose.html" name="choose"
onmouseover="underline('choose');clearMenus();"
onmouseout="removeUnderline('choose');">
<font id="choose">Choosing a Drum Kit</font></a>
</td>
<td><a href="maintenance.html" name="maintenance"
onmouseover="underline('tuning');showMenu('maintenance');"
onmouseout="removeUnderline('tuning');">
<font id="tuning">Tuning & Maintenance</font></a>
</td>
<td><a href="technique.html" name="technique"
onmouseover="underline('technique');clearMenus();"
onmouseout="removeUnderline('technique');">
<font id="technique">Proper Sticking & Technique</font></a>
</td>
<td><a href="rudiments.html" name="rudiments"
onmouseover="underline('beats');showMenu('rudiments');"
onmouseout="removeUnderline('beats');">
<font id="beats">Rudiments & Drum Beats</font></a>
</td>
<td><a href="percussion.html" name="percussion"
onmouseover="underline('aux');showMenu('percussion');"
onmouseout="removeUnderline('aux');">
<font id="aux">Auxiliary Percussion</font></a>
</td>
<td><a href="expand.html" name="expand"
onmouseover="underline('expand');clearMenus();"
onmouseout="removeUnderline('expand');">
<font id="expand">Expand Your Style</font></a>
</td>
</tr>
</table>
<hr>
<div>
</body>
</html>
Here is my css file:
.content{
position:absolute;
top:0px;
left:0px;
bottom:88px;
background-color:#ffff99;
width:100%;
z-index:0;
overflow:auto;
}
.maintenance{
font:9pt "Arial";
position:fixed;
left:125px;
bottom:0px;
z-index:-1;
}
.rudiments{
font:9pt "Arial";
position:fixed;
left:385px;
bottom:0px;
z-index:-100;
}
.percussion{
font:9pt "Arial";
position:fixed;
left:507px;
bottom:0px;
z-index:-100;
}
.foot {
position:fixed;
left:0px;
bottom:0px;
padding:0;
border-top:1;
background-color:green;
width:100%;
height:88px;
z-index:2;
}
a:link{
font:11pt "Arial";
text-decoration:none;
color:#ffff99;
}
a:visited {
font:11pt "Arial";
text-decoration:none;
color:#ffff99;
}
a:active {
font:11pt "Arial";
color:#00ff33;
}