I've fixed this after some trial and error in many different browsers, so here's the fix in case it helps someone.
To recap, the problem was that CSS Menus in IE7 would not highlight correctly, unless the user hovered over the text (rather than hovering over the space after the text).
Fix:
1) As afri-guy pointed out, IE7 needs to be told the width for the LI element (I guess it should trickle down from the parent but Microsoft's code is buggy). Here's a diff that shows the line to add to CSSMenuVertical.css to fix IE7:-
Code: Select all
ul.cssmenu-vertical li a {
display: block;
text-decoration: none;
color: #000077;
padding: 5px;
border: 1px solid #000077;
border-bottom: 0;
+ width: 158px; // WARNING. Breaks some browsers :-(
}
2) The problem here is that this breaks some browsers. You can try using IE's conditional comments here, but that's not really allowed in CSS files, and so of course it breaks yet more browsers if you do it!
So my dirty, dirty fix is to make two versions of CSSMenuVertical.css and tweak CSSMenu.module.php accordingly (you need to do this in two places)...
Code: Select all
if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/MSIE 7/', $_SERVER['HTTP_USER_AGENT']))
{
@readfile(dirname(__FILE__).'/CSSMenuVerticalIE7.css');
}
else
{
@readfile(dirname(__FILE__).'/CSSMenuVertical.css');
}
Dirty but it seems to do the job. (Tested in IE5.01, IE5.5, IE6, IE7, Firefox 1.5 and 2.0, Opera, Konqueror, Netscape, Safari, Camino on Win2K/XP, MacOS, Linux.)
A remaining bug is that my drop-down CSS Menus don't always rub themselves out correctly in Safari on the Mac (Intel Macbook). If anyone can suggest a fix for that, I'd be very grateful.
http://www.imba.org.uk