PunkSktBrdr01
11-12-2003, 04:35 PM
I'm trying to make a menu system similar to the Windows "Start" menu, and, like in Windows, I want it to appear when the user clicks on the "Menu" button. I wrote a simple function for this, but I can't get it to work. Here's the code:
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; ?>
<!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" xml:lang="en">
<head>
<title>Test Page</title>
<link rel="stylesheet" type="text/css" href="_style.php">
<script type="text/javascript">
function display(itemId) {
itemId = document.getElementById(itemId).style.visibility;
if (itemId == "hidden") {
itemId = "visible";
}
if (itemId == "visible") {
itemId = "hidden";
}
}
</script>
</head>
<body>
<!-- start item bar -->
<div id="itemBar">
<div id="itemBarMenu" onClick="display('menuMain');">
</div>
<div id="itemBarTime">
<?php
echo date("g:i a");
?>
</div>
</div>
<!-- end item bar -->
<!-- start main menu -->
<div id="menuMain">
<a href="#">item 1</a>
<a href="#">item 2</a>
<a href="#">item 3</a>
</div>
<!-- end main menu -->
</body>
</html>
I tested it in Firebird and IE6, and I can't figure out what the problem is. I also tried using onMouseOver and onMouseOut, but that didn't work either. Please help! :)
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; ?>
<!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" xml:lang="en">
<head>
<title>Test Page</title>
<link rel="stylesheet" type="text/css" href="_style.php">
<script type="text/javascript">
function display(itemId) {
itemId = document.getElementById(itemId).style.visibility;
if (itemId == "hidden") {
itemId = "visible";
}
if (itemId == "visible") {
itemId = "hidden";
}
}
</script>
</head>
<body>
<!-- start item bar -->
<div id="itemBar">
<div id="itemBarMenu" onClick="display('menuMain');">
</div>
<div id="itemBarTime">
<?php
echo date("g:i a");
?>
</div>
</div>
<!-- end item bar -->
<!-- start main menu -->
<div id="menuMain">
<a href="#">item 1</a>
<a href="#">item 2</a>
<a href="#">item 3</a>
</div>
<!-- end main menu -->
</body>
</html>
I tested it in Firebird and IE6, and I can't figure out what the problem is. I also tried using onMouseOver and onMouseOut, but that didn't work either. Please help! :)