Results 1 to 10 of 10

Thread: ddlevelsmenu wrapping issue on mobile/low resolution

  1. #1
    Join Date
    Mar 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question ddlevelsmenu wrapping issue on mobile/low resolution

    1) Script Title: All Levels Navigational Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...menu/index.htm

    3) Describe problem:

    On mobiles (or any low-resolution window; just resize browser to see problem), ddlevelsmenu doesn't wrap correctly. It wraps what looks like 1/2 or 1/4 of a line, which on a mobile is obviously non-optimal. We've been using the menu for years on our site (amphigory.com) but as mobiles become more popular we'd like to resolve the issue. I've looked into the CSS, and while I'm not a CSS wizard, I can't find anything obvious that would cause the issue.

    Any help?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    OK - add the following to your menu CSS;
    Code:
    .underlinemenu ul li {
    	float: left;
    	margin-bottom: 1em; /* change this if you need */
    }
    
    .underlinemenu ul li a {
    	white-space: nowrap;
    }
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Mar 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey! That makes it wrap correctly! But, it pushes the menu itself down on top of the box-shadow I have set on the wrapping div. You can see this @ www.amphigory.com ... I'll leave it up for a while since it's early and there's not much traffic. But I'll have to take it out eventually, since this "breaks" it for all users.

    Edit: played around with it; it's the float: left that causes it to drop into the box-shadow. But taking that out makes it stop wrapping correctly too, and there's the limit of my CSS wizardry.
    Last edited by Beverleyh; 03-05-2015 at 12:49 PM.

  4. #4
    Join Date
    Mar 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Fixed it (sort of) with a padding-bottom: on the wrapping div - that at least keeps the menu "inside" the box when it's in high-res. When wrapped, though, it still drops most of itself outside that box (wrapping div). Shouldn't that wrapping div expand since the content contained within has grown?

    (And I know this is outside the scope help with ddlevelsmenu, but any help would be greatly appreciated! Playing major catch-up here.)

  5. #5
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    No problem - I didn't see the shadow but you can easily fix the float issue by doing this to clear the float on the container;
    Code:
    .underlinemenu ul li {
    	float: left;
    	margin-bottom: 1em; /* change this if you need */
    	overflow:hidden;
    }
    
    .underlinemenu ul li a {
    	white-space: nowrap;
    }
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. #6
    Join Date
    Mar 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Huh - that had no effect.

    (BTW did I post something forbidden/outside the rules in my previous post? I noticed you edited it.)

  7. #7
    Join Date
    Mar 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ha, nevermind, I misunderstood that the overflow: needs to go on the wrapping div, not in the underlinemenu CSS I copied your code verbatim without applying logic. It's fixed.

    Thank you so much!

  8. #8
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Sorry, that was actually meant to be...
    Code:
    .underlinemenu ul {
    	overflow:hidden;
    }
    
    .underlinemenu ul li {
    	float: left;
    	margin-bottom: 1em; /* change this if you need */
    }
    
    .underlinemenu ul li a {
    	white-space: nowrap;
    }
    The post editing was just me following forum guidelines about new members and links. We remove active URLs to deter spammers (not you personally, but others looking in who try to post links that drive traffic to their stores, etc). Just housekeeping
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  9. #9
    Join Date
    Mar 2015
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oddly, putting the overflow: on the overall wrapping div (not part of the menu; the div that has the box-shadow) ALSO worked.

    No problem about the link; I didn't "mean to" make it a link, the forum software does that. I only posted it so that you could see it live, that's all.

    (Edit: and in fact, it has to be there; taking that off and putting it on the ul only selector in the ddlevelsmenu CSS makes it not work. BUT! You still helped us so much, thank you again.)

  10. #10
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I have plans to make this menu more mobile friendly in the coming weeks, maybe have the menu transform into a different, mobile optimized version when the screen is sufficiently small.
    DD Admin

Similar Threads

  1. ddlevelsmenu Hover issue in IE 11
    By kjriss088 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 05-30-2014, 01:08 AM
  2. ddlevelsmenu - mobile browser issue
    By semmel in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 04-02-2012, 03:09 PM
  3. CSS issue with ddlevelsmenu
    By tsutton in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 10-15-2011, 01:23 PM
  4. ddlevelsmenu - can it work on mobile browsers?
    By semmel in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 08-22-2011, 06:50 PM
  5. Replies: 0
    Last Post: 07-08-2011, 04:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •