Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript CSS/JS Dropdown menu, IE6 compatible

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #45700
    csmhowitzer
    Member

    Hey guys,

    I’m currently trying to implement a dropdown menu that will work in IE6. The :hover element doesn’t work properly (if at all) in IE6. So the solution I need for this will most likely come from javascript code. I’m using jquery myself. Here is a link to something I would like to have: [http://cognition.happycog.com/](http://cognition.happycog.com/ “Cognition Website”) (I’ve tested this website in IE6, and it works).

    I created a pen on CodePen with my code in it: [CodePen Link](http://codepen.io/csmhowitzer/details/hEJDg#pen-details-tab “CodePen Link”)

    jquery is a bit new to me, and the lifecycle of it. I’m trying to make it so when a menu topic is hovered over the dropdown is displayed and the user can select a link from there (simple right?), but it seems that you have to stay hovering over the parent menu item and then once you mouse off it the list disappears.

    Thanks, and hopefully this will be a useful post for others aswell.

    #139603
    Paulie_D
    Member

    Frankly, if IE6 is a requirement then perhaps JQuery is not for you…they are basically not supporting it any more.

    All you really need is a way to apply a certain class on a click (although frankly a hover is usually good enough) and a custom JS script should work for that.

    #139612
    csmhowitzer
    Member

    Oh, yeah I didn’t know that about JQuery losing support. I had issues with the :hover psuedo class, and I read from an article that :hover can only be applied to links that contain an href attribute in IE6 (source: [CSS Hover IE6 Fix](http://css-plus.com/2010/03/ie6-hover-fix/ “CSS Hover IE6 Fix”)). So the author’s solution was essentially what I used. He used JQuery and went off of the hover state, and I can do that with javascript aswell but JQuery includes the .hover() function.

    #139615
    CrocoDillon
    Participant

    I think the jQuery version 1.x branch keeps supporting IE 6, just stay away from 2.x

    #139616
    csmhowitzer
    Member

    yeah I’m working with 1.4 I think

    #139617
    Paulie_D
    Member

    Not that I’m ever…ever…going to worry about IE6 but the hover issue…

    > The :hover element doesn’t work properly (if at all) in IE6.

    As I understand it the hover function doesn’t work if there is no href attribute in the anchor link?

    Does it have to be a valid href or would `href=””` not solve the problem?

    Seriously, I have no idea….does anyone have any experience of this?

    #139627
    Senff
    Participant

    > As I understand it the hover function doesn’t work if there is no href attribute in the anchor link?

    I’m sure the problem is that hover doesn’t work on an LI. It should work fine on an A.

    #139638
    Paulie_D
    Member

    You could be right but I was going from this at the link given…

    >All modern browsers support the hover pseudo-class properly and it functions properly on any html element, however in IE6 **it can only be applied to `` links that contain the href attribute**.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.