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.

Dropdown menu Issue.HELP.

Discussion in 'JavaScript' started by mhelhudgens, Mar 23, 2013.

  1. #1
    Hello Guys,

    I created a vertical drop down menu and noticed that it's too long for a drop down, now I was thinking if there's a way that the drop down will appear or can be listed horizontally? Need help.
    You can find it here: wwwdotprintingshoppersdotcom


    Abbey
     
    mhelhudgens, Mar 23, 2013 IP
  2. creativewebmaster

    creativewebmaster Active Member

    Messages:
    654
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    78
    #2
    If, you have long drop down menu then, use mega menu. you can download source here http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-kick-butt-css3-mega-drop-down-menu/
     
    creativewebmaster, Mar 23, 2013 IP
  3. mhelhudgens

    mhelhudgens Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Hi creativewebmaster,

    I already tried mega menu plugins but it affects the loading time of the site. How will I prevent this from occurring? Thank you for your help.
     
    mhelhudgens, Mar 25, 2013 IP
  4. gandalf117

    gandalf117 Active Member

    Messages:
    111
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    it's not worth using plugins for this. Why don't you put some styles like:

    ul.sub-menu {
    overflow:auto;
    }

    ul.sub-menu li{
    display:block;
    float:left;
    }

    You will also have to restructure your HTML for this. You will have to take the <ul> element out of it's containing division. I am not sure if you will want to do all that I am just trying to point you in the right direction. You are probably going to need to include more styles than this.
     
    gandalf117, Apr 1, 2013 IP
  5. ImbaGroup

    ImbaGroup Greenhorn

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #5
    There are some techniques: http://rickbjarnason.com/creating-multi-column-lists-using-css/

    for 3rd technique if you have a dynamic menu (if it changes often) go with css3 selectors (even & odd), if you use static menuitems then of course it's easier to have the class names written by yourself.
     
    ImbaGroup, Apr 1, 2013 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    I'm just wondering why you posted this in Javascript, since unless you're talking scripting assist for IE6/earlier there is no reason for a dropdown menu to use scripting -- EVER.

    You didn't really share what is in the menu, without content it is nigh impossible to tell you what the proper markup and CSS should be.

    ... and really if you have enough items in a dropdown that you need to make it multiple columns, you've got too damned much **** in your menu! This is really true if you start thinking mobile, where dropdown menus don't even work, which is why I've swung an axe at them on my own sites in favor of more conventional navigation.

    Oh, and @gandalf117 -- floats are inherently display:block, there is no reason to ever say that on a float. It's why the IE hack of setting a float to display:inline to prevent margin doubling works -- it's ignored in all browsers in terms of making it 'inline', but for some reason makes IE stop stacking or doubling margins. The only display state that does ANYTHING to a float would be "display:none;"
     
    deathshadow, Apr 2, 2013 IP