CC to list since I don't know everything.

Theresa Newman wrote:
> Hi Alan,
> I tried the simple suggestion to convert the left value to a percentage to
> hide the submenu, but I still see stickiness.My simple page is below. if you
> view it in IE7, hover over middle menu (Anabantoidei), right click on any
> submenu item, then click on the first main menu item (Percoidei), then the
> Anabantodei submenu stays dropped.


And as your code currently stands, that how IE7 should work in it's 
buggy way. I myself don't notice it since I have javascript turned off 
in IE8 (with compMode IE7) so the javascript is not processed, only the 
  CSS is. Change the below,


> <script type="text/javascript">
> 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);
> </script>


to this,

<!--[if lt IE 7]>
<script type="text/javascript">
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);
</script>
<![endif]-->


so IE7 does not see that javascript or better still, like this in 
respect to the coding of the javascript.

<http://css-class.com/articles/ursidae/bears4.htm>


<!--[if lt IE 7]>
<script type="text/javascript" src="sfhover.js"></script>
<script type="text/javascript">
     addEvent(window, 'load', doIEStuff);
</script>
<![endif]-->


Another way is to hack the CSS (no IE CC or script in the HTML). Maybe 
some else on this list may have a better solution or see my solution as 
not working. Get whatever:hover from here.

<http://www.xs4all.nl/~peterned/csshover.html>


Then feed an invalid import to IE6 and IE7.

<http://css-class.com/test/css/selectors/ie/import-hacks.htm>


And use this in that IE6 and IE7 only CSS but using a IE6 targeting hack.

* html li { behavior: url("csshover3.htc"); }


When I have time, I will create a test case.


-- 
Alan http://css-class.com/
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to