Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  permalink
    This is really puzzling behavior. The drop down works fine in Firefox and IE7. It even works on the first page of the site in IE6.

    See www.metayage.com. The drop down for services and team works perfectly.

    However in any of the subpage of services it stops working.
    For example http://metayage.com/our-services/ip-audit/

    The code is exactly the same in both place. I can't seem to figure out why this is happening.
    • CommentAuthorrickhocutt
    • CommentTimeJul 18th 2007 edited
     permalink
    JugularBean,

    Unfortunately Internet Explorer doesn't handle the :hover pseudo class very well. put this code:

    <script type="text/javascript" src="mainNav.js"></script>

    in all of your pages somewhere between your head tags.

    then copy the code below into notepad or some text editor and name it "mainNav.js". That should solve your problem.


    sfHover = function() {
    var sfEls = document.getElementById("menu").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);


    Hope this helps,

    Rick
  2.  permalink
    Thanks for the reply Rick.

    If I understand correctly the javascript will attach "sfhover" to each of the li items in the menu, when the mouseover element is triggered. Right?

    Should there be some CSS for the sfhover class? Because there is no change.

    Also because of IE not handling the hover pseudoclass for non anchor elements I did include a .htc file that I found online that should ideally solve the problem. It's the Whatever:hover by Peter Nederlof

    What is strange is that the dropdown works fine from the home page, but not any of the other pages. If the hover pseudo class was not being recognised by IE6 then it shouldn't work on the home page either should it?

    This is reallllly weird!!
Add your comments
    Username Password
  • Format comments as (Help)