Results 1 to 4 of 4

Thread: AnyLink CSS Menu - Right Menu shifts left

  1. #1
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink CSS Menu - Right Menu shifts left

    1) Script Title: AnyLink CSS Menu

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

    3) Describe problem:
    The menu works fine when you have the browser window open wide, but when you narrow your browser window, the dropdown on the far right shifts to the left.

    Example:
    (URL removed - temporary demo)
    'Preschool', 'Kids' & 'Teens' are aligned correctly
    'Adults' is shifted to the left (when the browser window is not much bigger than the content).

    My 'problem' would be considered a 'feature' in other situations. If the rightmost menu is beyond the right edge of the browser, you WANT it to shift to the left. But my dropdown menu shifts to the left even if there is plenty of room for the menu.

    I suspect the issue is that the right menu has the following style...
    margin-left: -123px;
    For cosmetic reasons, the menu was shifted 123pixels to the left, but the browser still 'thinks' that the right menu extends way to the right of the page content (and thus shifts the menu to the left).

    Does that make sense?

    I hope so, since I'm baffled as to how to solve this.

    Thank you very much for any help you can give me
    Last edited by idesign123; 04-29-2007 at 07:02 PM. Reason: URL removed

  2. #2
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Anyone?
    I can put together a simplified demo if that would help.

    :Stacey

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the script, find this section and add the red parts:

    Code:
    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge=="rightedge"){
    //var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
    //dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    //if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
    edgeoffset=0//dropmenuobj.contentmeasure-obj.offsetWidth
    }
    else{
    var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
    var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
    if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
    edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
    }
    }
    return edgeoffset
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That fixed it!!!

    Thank you SO much

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
  •