Forum Moderators: not2easy

Message Too Old, No Replies

Dynamic Horizontal Menu Problem

Not working in IE 6

         

rjbearcan

6:08 am on Dec 10, 2007 (gmt 0)

10+ Year Member



Good evening everyone,
I am trying to use a pop over menu for a client and I'm having a hard time getting it to work in IE 6. As the user goes down the menu on the left side of my screen, at certain products, a list of subcategories are supposed to appear and it works great in Firefox and IE7.

I thought the problem was that there were links that would be under where the subcategories would appear, and while that is a reason why the menus disappear, in IE6, they just don't pop up at all.

Any help at all would be greatly appreciated.

Here's my code:

HTML
<ul id="nav">
<li><a href="#">Civilian Site</a>
<ul>
<li><a href="#">Breathing</a></li>
<li><a href="#">Protective Clothing</a></li>
</ul>
</li>
<li><a href="#">Ergonomics</a>
<ul>
<li><a href="#">Back</a></li>
<li><a href="#">Matts</a></li>
</ul>
</li>
</ul>

CSS
ul {
margin: 0;
padding: 0;
list-style: none;
width: 175px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}

ul li {
position: relative;
}

li ul {
position: absolute;
left: 174px;
top: 0;
display: none;
z-index:500;
}

ul li a {
display: block;
text-decoration: none;
font-weight:bold;
color: #ffffff;
background: #CB0202;
padding: 3px;
border-bottom: 0;
}

/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; }
* html ul li a { height: 1%; }
/* End */

li:hover ul, li.over ul {
display: block; }

SuzyUK

9:50 am on Dec 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



li:hover ul, li.over ul {..

IE6 and below does not support

:hover
on any element except the <a> element, this was always the problem for drop menus, and means IE6 needs something else, script or behavior, to help it work ;)

You can use a "suckerfish" style JavaScript, which I think is what your CSS refers to.. li.over

- or you can plug in the whatever:hover behaviour file. The behavior file (Version 1.42.060206) should just need uploaded to your server, preferably same directory as your CSS file, and is referenced from the CSS like so:

body { behavior:url("csshover.htc"); }

you can also place some JS directly in your CSS file, or in a conditional comment, which might be useful for testing. - see whatever:hover script in CSS [webmasterworld.com] - that link also has the link to the full behavior file

-Suzy

[edited by: SuzyUK at 9:53 am (utc) on Dec. 10, 2007]

rjbearcan

4:15 pm on Dec 10, 2007 (gmt 0)

10+ Year Member



Hi Suzy, I forgot to add in the javascript file which made me feel very frustrated then very stupid...lol

However I am still having a problem. I have a div that holds the text for the page and in IE, when I move off the original list and into the pop up menu, the menu appears under the text in the div. I've tried z-index on my div and in the menu to fix the problem but it still persists. Any suggestions?