Unsolved dropdown menu

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2006
Posts: 4
Reputation: ahr3n3 is an unknown quantity at this point 
Solved Threads: 0
ahr3n3 ahr3n3 is offline Offline
Newbie Poster

Unsolved dropdown menu

 
0
  #1
Jun 28th, 2006
Hi, I urgently need someone's help. Any kind sou(s) will be greatly appreaciated. I've tried solving this problem for like three days. At first, my problem is I can't hide my sub-links. Now, I'm able to hide all of them. But it can't be showed when hovered. I understand that I do not have javascript n that's causing part of e problem. I believe there's some other things that's creating the problem. I do not what code to put for e javascript too. Please help...

Code:
<tr bgcolor="#cc0000">
    <td height="36" colspan="5" valign="middle">
 <div id="navcontainer">
 <ul id="nav">
 <li><a href="hometry.html">Home</a></li>
 <li><a href="#">About Us ></a></li>
 <ul>
 <li><a href="#">History</a></li>
 <li><a href="#">Letter from The Club President   ></a></li>
 <ul>
 <li><a href="#">2006-2007 Committee</a></li>
 <li><a href="#">Immediate Past Committee</a></li>
 </ul>
 <li><a href="#">Letter from The Consul-General</a></li>
 </ul>
 <li><a href="#">News   ></a></li>
 <ul>
 <li><a href="#">News & Upcoming Events ></a></li>
 <ul>
 <li><a href="#">Monthly Calendar of Events</a></li>
 </ul>
 <li><a href="#">Current News</a></li>
 </ul>
 <li><a href="#">Past Events  ></a></li>
 <ul>
 <li><a href="#">2006</a></li>
 <li><a href="#">2005</a></li>
 <li><a href="#">2004</a></li>
 </ul>
 <li><a href="#">Membership ></a></li>
 <ul>
 <li><a href="#">Types of Membership</a></li>
 <li><a href="#">Benefits</a></li>
 <li><a href="#">Apply Now!</a></li>
 <li><a href="#">Directory ></a></li>
 <ul>
 <li><a href="#">2003-2004</a></li>
 <li><a href="#">2004-2005</a></li>
 <li><a href="#">2005-2006</a></li>
 </ul></ul>
 <li><a href="#">Sponsors</a></li>
 <li><a href="#">Partners</a></li>
 <li><a href="#">Contact Us</a></li>
 <li><a href="#">Site Map</a></li>
 </ul>
</div>
 </td>
  </tr>

CSS:
#navcontainer
{
background: #CC0000;
margin: 0 auto;
padding: 1em 0 0 0;
font-family: georgia, serif;
height: 35px;
}
/* to stretch the container div to contain floated list */
#navcontainer:after
{
content: ".";
display: block;
line-height: 1px;
font-size: 1px;
clear: both;
}
#nav, #nav ul
{
list-style: none;
padding: 0;
margin: 0;
width: 98%;
font-size: 0.92em;
text-align: center;
background: #cc0000;
line-height: 1;
}
#nav ul
{
position: absolute;
top: 0;
left: 100%;
}
#nav ul ul
{
position: absolute;
z-index: 500;
}
#nav a
{
display: block;
width: 10em;
}
#nav li
{
display: block;
float: left;
width: 8em;
margin: 0;
padding: 0;
position: relative;
}
#nav li ul
{
  position: absolute; 
  left: -999em;
  width: 10em;
  display: none;
}
#nav li:hover ul
{
left: auto;
}
sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover);
#nav li ul
{
left: auto;
display: none;
}
#nav li>ul
{
top: auto;
left: auto; 
}
#nav li a
{
display: block;
width: 100%;
padding: 0.5em;
border-width: 2px;
border-color: #ffe #aaab9c #ccc #fff;
border-style: solid;
color: #777;
text-decoration: none;
background: #f7f2ea;
}
#navcontainer>#nav li a { width: auto; }
#nav li#active a
{
background: #f0e7d7;
color: #800000;
}
#nav li a:hover, #nav li#active a:hover
{
color: #800000;
background: transparent;
border-color: #aaab9c #fff #fff #ccc;
}
#nav li:hover > ul {
    display: block;
}
#nav li:hover ul, li.over ul{ display: block; }

#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul 
{
left: -999em;
display: block; 
}
 
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { 
left: auto; 
display: block
}
#nav li:hover ul, #nav li.sfhover ul { 
left: auto; 
display: none;
}
#nav li ul ul { 
margin: -1em 0 0 10em;
display: none; 
}
 
#nav li:hover ul ul, #nav li.sfhover ul ul { 
left: -999em; 
display: block;
}
#nav li:hover ul, #nav li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul { 
left: auto; 
display: block;
}
Last edited by cscgal; Jun 28th, 2006 at 2:11 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,026
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 125
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Unsolved dropdown menu

 
0
  #2
Jun 28th, 2006
Unfortunately I don't have the time to debug your CSS for you. However, take a look at DaniWeb's HTML code and how we do our navigation menu. It's CSS only (no JavaScript).
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,026
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 125
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Unsolved dropdown menu

 
0
  #3
Jun 28th, 2006
P.S. I put your code in [code] tags for you.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 4
Reputation: ahr3n3 is an unknown quantity at this point 
Solved Threads: 0
ahr3n3 ahr3n3 is offline Offline
Newbie Poster

Re: Unsolved dropdown menu

 
0
  #4
Jun 28th, 2006
I'm sorry, but I don't quite understand by "P.S. I put your code in [code] tags for you. "I am glad that you reply me. I've seen Daniweb's site. I don't quite understand the coding. I'm doing my site using Dreamweaver, can I set iframe from there? I'm so sorry but I'm quite a noob in this.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,026
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 125
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Unsolved dropdown menu

 
0
  #5
Jun 28th, 2006
What I mean is that for the code you provided in your first post, I edited it to be [php]
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. .....
[/php] so that it is easier to read.

You shouldn't be using an iframe
Last edited by cscgal; Jun 28th, 2006 at 3:01 am.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 4
Reputation: ahr3n3 is an unknown quantity at this point 
Solved Threads: 0
ahr3n3 ahr3n3 is offline Offline
Newbie Poster

Re: Unsolved dropdown menu

 
0
  #6
Jun 28th, 2006
Oh, alright. I got what you meant. Thank you!
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 4
Reputation: ahr3n3 is an unknown quantity at this point 
Solved Threads: 0
ahr3n3 ahr3n3 is offline Offline
Newbie Poster

Re: Unsolved dropdown menu

 
0
  #7
Jun 28th, 2006
Oh sorry, I just realised that u said I shouldn't be using iframe. So to your opinion, what should I use?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC