•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 455,965 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,684 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 738 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi everyone, I'm creating a menu for a website I'm building. When you mouseover one of the boxes, a sub-menu appears beneath it. Everything looks right, but when you roll your mouse over it, nothing happens.
Main page:
<html>
<head>
<link rel="stylesheet" href="menu.css" type="text/css">
<title></title>
</head>
<body>
<span class="Tab" onMouseOver="MakeVisible('Menu')"<Menu</span>
<span class="Tab" onMouseOver="MakeVisible('Games')">Games</span>
<span class="Tab" onMouseOver="MakeVisible('Animations')">Animations</span>
<span class="Tab" onMouseOver="MakeVisible('Forum')">Forum</span>
<span class="Tab" onMouseOver="MakeVisible('Meet The Staff')">Meet The Staff</span>
<span class="Tab" onMouseOver="MakeVisible('Rate Our Website')">Rate Our Website</span>
<span class="Tab" onMouseOver="MakeVisible('Website Statistics')">Website Statistics</span>
<div id="Menu" class="Links">
<a href="menu.html" target="Main">Main Page</a>
</div>
<div id="Games" class="Links">
<a href="games.html" target="Main">Main Page</a>
<a href="games.html#ping_pong" target="Main">Ping Pong</a>
</div>
<div id="Animations" class="Links">
<a href="animations.html" target="Main">Main Page</a>
<a href="animations.html#jack" target="Main">Jack</a>
</div>
<div id="Forum" class="Links">
<a href="forum.html" target="Main">Main Page</a>
</div>
<div id="Meet The Staff" class="Links">
<a href="bio.html" target="Main">Main Page</a>
<a href="bio_metroid12.html" target="Main">Metroid 12</a>
<a href="bio_darthyassen.html" target="Main">Darth Yassen</a>
<a href="bio_alfalfa.html" target="Main">Alfalfa</a>
<a href="bio_pandaman.html" target="Main">Panda Man</a>
</div>
<div id="Rate Our Website" class="Links">
<a href="rating.html" target="Main">Main Page</a>
</div>
<div id="Website Statistics" class="Links">
<a href="stat.html" target="Main">Main Page</a>
</div>
<script type="text/javascript">
function MakeVisible(tab, element){
var links = document.getElementsByTagName("div")
for (var j = 0; j <tabs.length; j++){
if (links[j].className == 'Links') links[j].style.display = "none"
}
var element = document.getElementById(element)
element.style.display = "block"
}
</script>
</body>
</html>
The style sheet:
.Tab{
font-weight: bold;
padding: 5px;
border-style: solid;
border-width: 1px;
}
body{
font-family: Veranda, sans-serif;
}
.Links{
display: none;
border-width: 1px;
border-style: solid;
padding: 10px;
background-color: lightyellow;
font-size: x-small;
}
You can see it at http://www.freewebs.com/blubswebsite/side%5Fmenu.html
Main page:
<html>
<head>
<link rel="stylesheet" href="menu.css" type="text/css">
<title></title>
</head>
<body>
<span class="Tab" onMouseOver="MakeVisible('Menu')"<Menu</span>
<span class="Tab" onMouseOver="MakeVisible('Games')">Games</span>
<span class="Tab" onMouseOver="MakeVisible('Animations')">Animations</span>
<span class="Tab" onMouseOver="MakeVisible('Forum')">Forum</span>
<span class="Tab" onMouseOver="MakeVisible('Meet The Staff')">Meet The Staff</span>
<span class="Tab" onMouseOver="MakeVisible('Rate Our Website')">Rate Our Website</span>
<span class="Tab" onMouseOver="MakeVisible('Website Statistics')">Website Statistics</span>
<div id="Menu" class="Links">
<a href="menu.html" target="Main">Main Page</a>
</div>
<div id="Games" class="Links">
<a href="games.html" target="Main">Main Page</a>
<a href="games.html#ping_pong" target="Main">Ping Pong</a>
</div>
<div id="Animations" class="Links">
<a href="animations.html" target="Main">Main Page</a>
<a href="animations.html#jack" target="Main">Jack</a>
</div>
<div id="Forum" class="Links">
<a href="forum.html" target="Main">Main Page</a>
</div>
<div id="Meet The Staff" class="Links">
<a href="bio.html" target="Main">Main Page</a>
<a href="bio_metroid12.html" target="Main">Metroid 12</a>
<a href="bio_darthyassen.html" target="Main">Darth Yassen</a>
<a href="bio_alfalfa.html" target="Main">Alfalfa</a>
<a href="bio_pandaman.html" target="Main">Panda Man</a>
</div>
<div id="Rate Our Website" class="Links">
<a href="rating.html" target="Main">Main Page</a>
</div>
<div id="Website Statistics" class="Links">
<a href="stat.html" target="Main">Main Page</a>
</div>
<script type="text/javascript">
function MakeVisible(tab, element){
var links = document.getElementsByTagName("div")
for (var j = 0; j <tabs.length; j++){
if (links[j].className == 'Links') links[j].style.display = "none"
}
var element = document.getElementById(element)
element.style.display = "block"
}
</script>
</body>
</html>
The style sheet:
.Tab{
font-weight: bold;
padding: 5px;
border-style: solid;
border-width: 1px;
}
body{
font-family: Veranda, sans-serif;
}
.Links{
display: none;
border-width: 1px;
border-style: solid;
padding: 10px;
background-color: lightyellow;
font-size: x-small;
}
You can see it at http://www.freewebs.com/blubswebsite/side%5Fmenu.html
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Clean Previous Next Script for MySQL results (PHP)
- The name for the Resize Button to ad to Script (HTML and CSS)
- Random Programming Script (Computer Science and Software Design)
- Importing SQL Script File - Urgent !! (Database Design)
- Script problems with IE (Web Browsers)
- Help with shell script to auto gzip a .sql dump after backup (Shell Scripting)
- Adding mutiple PC's to an OU via script? (Windows NT / 2000 / XP / 2003)
- Table of Contents Script (Java)
- ASP slow-down server script (ASP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Please help!!
- Next Thread: Pages Not rendering In Mozilla Help?


Linear Mode