J
jmensch
I'm reasonably new to JavaScript and DHTML,
so I'm sorry if this is an obvious mistake.
The following snippet of code is intended to
make the menu -- the absolute-positioned <div>
section -- disappear when one mouses over the
graphic, but instead it generates a "document.
menu_admin has no properties" error in Firefox
and does nothing in IE. Can someone tell me
what it is that I'm doing wrong here?
Ironically, when you replace "menu_admin"
with "omv" in the function, it works fine to
make the image disappear, but no such luck
with the <div>-box.
-- Julian Mensch
----------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<style type="text/css">
<!--
.menu1
{
position: absolute;
left: 100px;
top: 100px;
background-color: #000077;
color: #FFFFFF;
z-index: 2;
visibility:visible;
}
-->
</style>
</head>
<body>
<div id="menu_admin" class="menu1">
<b>Admin Pages</b>
<br>Add New Book
<br>List Popular
<br>Edit User Accounts
<br>Backup Database
</div>
<img id="omv" src="tab_admin.gif" onMouseOver="onMouseOver1()">
<script language="javascript">
function onMouseOver1()
{
document.menu_admin.style.visibility = "hidden";
}
</script>
</body>
</html>
so I'm sorry if this is an obvious mistake.
The following snippet of code is intended to
make the menu -- the absolute-positioned <div>
section -- disappear when one mouses over the
graphic, but instead it generates a "document.
menu_admin has no properties" error in Firefox
and does nothing in IE. Can someone tell me
what it is that I'm doing wrong here?
Ironically, when you replace "menu_admin"
with "omv" in the function, it works fine to
make the image disappear, but no such luck
with the <div>-box.
-- Julian Mensch
----------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<style type="text/css">
<!--
.menu1
{
position: absolute;
left: 100px;
top: 100px;
background-color: #000077;
color: #FFFFFF;
z-index: 2;
visibility:visible;
}
-->
</style>
</head>
<body>
<div id="menu_admin" class="menu1">
<b>Admin Pages</b>
<br>Add New Book
<br>List Popular
<br>Edit User Accounts
<br>Backup Database
</div>
<img id="omv" src="tab_admin.gif" onMouseOver="onMouseOver1()">
<script language="javascript">
function onMouseOver1()
{
document.menu_admin.style.visibility = "hidden";
}
</script>
</body>
</html>