CSS Menu: 2nd child not shown in IE

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
Reggie

CSS Menu: 2nd child not shown in IE

Post by Reggie »

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:

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%;
	}

IE-Fix CSS (only for IE)

Code: Select all

#primary-nav ul {
	position: absolute;
	top: auto;
        margin-top: 24px;
	display: none;
        margin-left: -100%
	}
Smarty Menu-Code:

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}
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: CSS Menu: 2nd child not shown in IE

Post by KO »

Do you have the Javascript in your template header?
Locked

Return to “Layout and Design (CSS & HTML)”