CSS Menu: 2nd child not shown in IE
Posted: Tue May 15, 2007 5:29 pm
Hi,
I'm adjusting a css drop down menu. It's almost working, but I've got one problem which I'm not able to fix
The problem lays in the 2nd level of the drop down. It just doesn't pop up when you hover the first child.
I can however make the menu popup by changing "position: relative;" to "position: fixed" in "#primary-nav li li" (see css code below), but then the 2nd level just stays on top (well duh
)
Could anyone help me out here ?
CSS:
IE-Fix CSS (only for IE)
Smarty Menu-Code:
I'm adjusting a css drop down menu. It's almost working, but I've got one problem which I'm not able to fix

The problem lays in the 2nd level of the drop down. It just doesn't pop up when you hover the first child.
I can however make the menu popup by changing "position: relative;" to "position: fixed" in "#primary-nav li li" (see css code below), but then the 2nd level just stays on top (well duh

Could anyone help me out here ?
CSS:
Code: Select all
#menuwrapper {
/*overflow: hidden;*/
}
/* Set the width of the menu elements at second level. Leaving first level flexible. */
#primary-nav li li {
width: 200px;
}
/* Unless you know what you do, do not touch this */
#primary-nav, #primary-nav ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#primary-nav ul {
position: absolute;
top: auto;
margin-top: 24px;
display: none;
}
#primary-nav ul ul {
margin-top: 1px;
margin-left: -1px;
left: 100%;
top: 0px;
}
#primary-nav li {
margin-left: -1px;
float: left;
margin-right: 25px;
}
#primary-nav li:hover {
}
#primary-nav li li {
margin-left: 0px;
margin-top: -1px;
float: none;
}
/* Styling the basic apperance of the menu elements */
#primary-nav a {
display: block;
margin: 0px;
padding: 5px 10px;
text-decoration: none;
}
#primary-nav li a {
color: #FFFFFF;
}
#primary-nav li li a {
color: #4A4A4A;
}
#primary-nav li ul li {
}
#primary-nav li ul li a:hover {
font-weight: bold;
}
#primary-nav li ul li {
background-color: white;
opacity:.94;
filter: alpha(opacity=94);
-moz-opacity: 0.94;
color : #000000;
}
#primary-nav li.menuparent {
}
/* Styling the basic apperance of the active page elements (shows what page in the menu is being displayed) */
#primary-nav li.menuactive {
}
/* Styling the basic apperance of the menuparents - here styled the same on hover (fixes IE bug) */
#primary-nav ul li.menuparent, #primary-nav ul li.menuparent:hover, #primary-nav ul li.menuparent {
background-image: url(modules/MenuManager/images/arrow.gif);
background-position: center right;
background-repeat: no-repeat;
}
/* Styling the apperance of menu items on hover */
#primary-nav li:hover, #primary-nav li.menuh, #primary-nav li.menuparenth, #primary-nav li.menuactiveh {
}
#primary-nav ul li a:hover, #primary-nav ul li ul li{
display: block;
}
/* The magic - set to work for up to a 3 level menu, but can be increased unlimited */
#primary-nav ul, #primary-nav li:hover ul, #primary-nav li:hover ul ul,
#primary-nav li.menuparenth ul, #primary-nav li.menuparenth ul ul {
display: none;
}
#primary-nav li:hover ul, #primary-nav ul li:hover ul, #primary-nav ul ul li:hover ul,
#primary-nav li.menuparenth ul, #primary-nav ul li.menuparenth ul, #primary-nav ul ul li.menuparenth ul{
display: block;
}
/* IE Hacks */
#primary-nav li li {
float: left;
clear: both;
}
#primary-nav li li a {
height: 1%;
}
/* Set the width of the menu elements at second level. Leaving first level flexible. */
#primary-nav li li {
width: 200px;
}
/* Unless you know what you do, do not touch this */
#primary-nav, #primary-nav ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#primary-nav ul {
position: absolute;
top: auto;
margin-top: 24px;
display: none;
}
#primary-nav ul ul {
margin-top: 1px;
margin-left: -1px;
left: 100%;
top: 0px;
}
#primary-nav li {
margin-left: -1px;
float: left;
margin-right: 25px;
}
#primary-nav li:hover {
}
#primary-nav li li {
margin-left: 0px;
margin-top: -1px;
float: none;
position: relative;
}
/* Styling the basic apperance of the menu elements */
#primary-nav a {
display: block;
margin: 0px;
padding: 5px 10px;
text-decoration: none;
}
#primary-nav li a {
color: #FFFFFF;
}
#primary-nav li li a {
color: #4A4A4A;
}
#primary-nav li ul li {
}
#primary-nav li ul li a:hover {
font-weight: bold;
}
#primary-nav li ul li {
background-color: white;
opacity:.94;
filter: alpha(opacity=94);
-moz-opacity: 0.94;
color : #000000;
}
#primary-nav li.menuparent {
}
/* Styling the basic apperance of the active page elements (shows what page in the menu is being displayed) */
#primary-nav li.menuactive {
}
/* Styling the basic apperance of the menuparents - here styled the same on hover (fixes IE bug) */
#primary-nav ul li.menuparent, #primary-nav ul li.menuparent:hover, #primary-nav ul li.menuparent {
background-image: url(modules/MenuManager/images/arrow.gif);
background-position: center right;
background-repeat: no-repeat;
}
/* Styling the apperance of menu items on hover */
#primary-nav li:hover, #primary-nav li.menuh, #primary-nav li.menuparenth, #primary-nav li.menuactiveh {
}
#primary-nav ul li a:hover, #primary-nav ul li ul li{
display: block;
}
/* The magic - set to work for up to a 3 level menu, but can be increased unlimited */
#primary-nav ul, #primary-nav li:hover ul, #primary-nav li:hover ul ul,
#primary-nav li.menuparenth ul, #primary-nav li.menuparenth ul ul {
display: none;
}
#primary-nav li:hover ul, #primary-nav ul li:hover ul, #primary-nav ul ul li:hover ul,
#primary-nav li.menuparenth ul, #primary-nav ul li.menuparenth ul, #primary-nav ul ul li.menuparenth ul{
display: block;
}
/* IE Hacks */
#primary-nav li li {
float: left;
clear: both;
}
#primary-nav li li a {
height: 1%;
}
Code: Select all
#primary-nav ul {
position: absolute;
top: auto;
margin-top: 24px;
display: none;
margin-left: -100%
}
Code: Select all
{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li class="menuactive menuparent"><a class="menuactive menuparent" {elseif $node->current == true}
<li class="menuactive"><a class="menuactive" {elseif $node->haschildren == true}
<li class="menuparent"><a class="menuparent" {else}
<li><a {/if}
href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>{/foreach}
{repeat string="</li></ul>" times=$node->depth-1} </li>
</ul>
</div>
{/if}