Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: jqueryslidemenu width problems

  1. #1
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default jqueryslidemenu width problems

    http://www.dynamicdrive.com/style/cs...el_css_menu_2/

    I'm having a width problem with jqueryslidemenu. I have a fixed width menu, but my right-most submenus are quite wide and go beyond the width of my content area.

    I tried doing a negative margin but then it just floats around with the size of the window as I resize it.

    The demo page is at http://www.numarasoftware.com/default2.asp

    Any thoughts on correctly positioning so everything lines up?

    JP
    Last edited by ddadmin; 01-10-2009 at 06:01 AM. Reason: added link

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

    Default

    Do you mean the sub menus associated with the "Contact" menu item? It's a thin drop down menu for me and doesn't go over the right edge of the browser window. Or maybe I'm misunderstanding something?
    DD Admin

  3. #3
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    I'm not sure I understand what you mean either, but in case I do, this might help, try decreasing this width:
    Code:
    <li style="width: 250px;">

  4. #4
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    The About and the Services menu go well past the right edge. I dont want to cause any of the menu items to wrap. I know I have some room to play with, but not enough.

    Thoughts?

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

    Default

    Here's a screenshot of the About Submenu for me:



    In other words, it does drop down to the left of the browser's right edge when there isn't enough space to the right. Still not sure what you mean by not wrapping.
    DD Admin

  6. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    I think he/she means that it should drop down to the left even if there is enough space, that it should treat the end of the page as the browser edge.

  7. #7
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Here is my screenshot. The drop down moves left to right based on my browser screen size. It is preferable that it align where I want it rather than floating around.

    In this screenshot, it goes past the right edge of the content area, whereas in your screenshot, your browser window is probably shrunk down a fair amount and thus is in the middle.


  8. #8
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Any thoughts on this? I could potentially figure this out recoding the whole thing, but want to avoid that. Ideas?

  9. #9
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Find this in your jqueryslidemenu.js file on row 34:
    Code:
    menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
    and change the highlighted to this:
    Code:
    menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$('#myslidemenu').width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
    That will make the submenus open towards the left (like they would if the browser window was too small) if they are wider than the menu when opening to the right.

  10. #10
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Great! That worked.

    Now for the next trick . I'm planning on using background images and I saw your code in another post for that and dont have a problem with that. But how can I keep the mouseover image changed for the top menu when the mouse is over UL for the submenu?

    thanks,
    JP

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
  •