flare1028us
09-30-2004, 11:37 PM
Hey,
I just started messing with DHTML a while ago and have already created a
working menu. I am now on my second project, a drop-down menu.
I have the following problem: My menu disappears when I put my cursor
over it. You can see the menu here (http://www.flare-designs.cjb.net/newdrop.html).
Here is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<style type="text/css">
.menut
{
width:100;
border-style:solid;
border-width:3;
}
#menu
{
position:relative;
width:100;
height:200;
left:10;
top:-250;
background-color:lightblue;
}
#menut
{
width:100;
position:relative;
top:-160;
border-style:solid;
border-width:3;
}
.menutd
{
border:15;
background-color:lightblue;
}
</style>
<script language="javascript">
function go(loc)
{
window.location=loc
}
function sel(ci)
{
ci.style.backgroundColor="lightgray";
}
function unsel(ci)
{
ci.style.backgroundColor="lightblue";
}
function shwmen()
{
document.getElementById("menu").style.top=20;
}
function hdmen()
{
document.getElementById("menu").style.top=-250;
}
</script>
</HEAD>
<BODY><a onmouseover="shwmen()">Menu</a>
<div id="menu" onmouseout="hdmen()">
<table id="menut" border="0" width="100">
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this); shwmen();">Item 1</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this); shwmen();">Item 2</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 3</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 4</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 5</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 6</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 7</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 8</td></tr><br>
</tr></table>
</BODY>
</HTML>
Can anyone please tell me what I am doing wrong?
Any help would be appreciated.
Thanks in advance,
Carl
I just started messing with DHTML a while ago and have already created a
working menu. I am now on my second project, a drop-down menu.
I have the following problem: My menu disappears when I put my cursor
over it. You can see the menu here (http://www.flare-designs.cjb.net/newdrop.html).
Here is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<style type="text/css">
.menut
{
width:100;
border-style:solid;
border-width:3;
}
#menu
{
position:relative;
width:100;
height:200;
left:10;
top:-250;
background-color:lightblue;
}
#menut
{
width:100;
position:relative;
top:-160;
border-style:solid;
border-width:3;
}
.menutd
{
border:15;
background-color:lightblue;
}
</style>
<script language="javascript">
function go(loc)
{
window.location=loc
}
function sel(ci)
{
ci.style.backgroundColor="lightgray";
}
function unsel(ci)
{
ci.style.backgroundColor="lightblue";
}
function shwmen()
{
document.getElementById("menu").style.top=20;
}
function hdmen()
{
document.getElementById("menu").style.top=-250;
}
</script>
</HEAD>
<BODY><a onmouseover="shwmen()">Menu</a>
<div id="menu" onmouseout="hdmen()">
<table id="menut" border="0" width="100">
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this); shwmen();">Item 1</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this); shwmen();">Item 2</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 3</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 4</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 5</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 6</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 7</td></tr><br>
<tr><td colspan="2" onclick="go('http://www.google.com')" width="500" class="menutd" onmouseover="sel(this)" onmouseout="unsel(this)">Item 8</td></tr><br>
</tr></table>
</BODY>
</HTML>
Can anyone please tell me what I am doing wrong?
Any help would be appreciated.
Thanks in advance,
Carl