1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Drop-down nav menus, IE6 and FF

Discussion in 'CSS' started by Stomme poes, Jul 6, 2007.

  1. #1
    I've found a couple of nice sites that have CSS code for dropdown navs, and they look nice, so I told my colleague next to me to try that instead of javascripting every single menu option (we're still slowly changing the site from html-design to css design).

    Results using code from these sites looks great in FF and Opera (9+) but in IE the menu was an up-and-down list.

    So for the first time I looked at this one site in IE (using Linux I have a fake IE that doesn't always render sites like native IEs do), and it was also a left-sided list.

    Site: http://phoenity.com/newtedge/horizontal_nav/

    Looking around here for people with nav problems, I couldn't tell whether this was a specific IE problem, a quirks mode thing, or haslayout problem.

    In one thread Dan says something about adding another float:left to the second id. But there's not always more than one #id, or there's only a class. I'm still learning CSS and html so I may not be clear on when to use one or the other.


    Here's his site looking fine with an old FF: http://s34.photobucket.com/albums/d136/schroedingerscat/?action=view&current=FFScreenshot.png

    Here's the site looking like ours now does in IE6 and 7:
    http://s34.photobucket.com/albums/d136/schroedingerscat/?action=view&current=IEScreenshot.png

    I made these as links because I didn't shrink the images down.

    Anyway, I'd like to insist our site use as much css as possible and as little scripting as possible, and though there were many similar codes for making nav buttons, I'd like to know what the cause is in this. I'm sure it's a one-liner.
     
    Stomme poes, Jul 6, 2007 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Yeah, that site doesn't work in IE correctly, mostly from buggy positioning code and little or no attempt to support IE.

    TYPICAL. Of course, there are the telltale warnings when you look at their deployed code with the crappy formatting and unneccessary presentational tags... and the use of display:table-cell

    Hang on, I'll toss together an example based on theirs that actually WORKS cross-browser...
     
    deathshadow, Jul 6, 2007 IP
    Stomme poes likes this.
  3. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #3
    google for stu nichols -> click on menus and bam.. there ya go.
     
    soulscratch, Jul 6, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Dan Schulz, Jul 6, 2007 IP
  5. JOGS_DEV

    JOGS_DEV Peon

    Messages:
    136
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah, Suckerfish menus is the way to go, I use them on most of the web sites - haven't had any problems so far.
     
    JOGS_DEV, Jul 7, 2007 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Okay, suckerfish is saying that javascript is to be used against IE mousehover problem-- is this still for IE7?

    The original idea to get away from javascript (not that 12 lines in CSS sheet is bad compared to the 2 paragraphs we have plus the 2 lines for every single menu option : ) was inspired we I re-found the monkeyflash page on navbars that someone here a long time ago linked to. We were like, o wow!

    But then we were like, oh, we have sub-menus, up to three layers.

    So I know I don't understand everything, but it looks like on Suckerfish that for every layer you add, you need to make new ids and set params for each. Can't that be turned into some kind of global that is inherited down? Because we've only got 3 layers but hoped that if say a 4th layer or so was needed, that simply adding the next li in the html would do it.
    Does Suckerfish do this because it ensures total cross-browser compatability, or to make what they're doing more clear to someone trying their code out? Or does it have something to do with the way they position the sub-menus (ours are supposed to extend the drop-down box (and cover the page, not push it down), not make new boxes appear to the right of the original box).

    In any case, thanks for the link; Suckerfish is bookmarked with the others (most of which I get from here, esp any pages gary links to). Must I dash my hopes for removing javascript though, with a menu with sub-menus? I was hoping we could avoid them (maybe this is because of the NoScripts thing my hubby put on his FF/Iceweasel, which trips me up because I always forget it's on, so I want our site to be as script-free as reasonably possible).

    How do I give a rep? Eh, I'll read the FAQ again. Reps for dan and deathshadow.
     
    Stomme poes, Jul 7, 2007 IP
  7. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #7
    I believe you just need to target IE6.

    if (document.all && !window.opera && typeof window.XMLHttpRequest == "undefined") {
    // and here you add a class to the parent LIs with JS
    }
     
    soulscratch, Jul 7, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Suckerfish isn't needed for IE 7. I've found that it'll run just fine inside a regular JavaScript file (without need for conditional comments or document.all sniffing).

    And adding that line of code isn't necessary either.
     
    Dan Schulz, Jul 7, 2007 IP