Results 1 to 4 of 4

Thread: AnyLink CSS Menu - pushes up in small browser windows

  1. #1
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink CSS Menu - pushes up in small browser windows

    1) Script Title: AnyLink CSS Menu (horizontal)

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

    3) Describe problem: I'm having a problem if the browser window is small and the dropdown menu is large. For some reason the menu goes up in this case. Is there a way to force it to always go down?

    I was able to recreate it by going to http://www.dynamicdrive.com/dynamici...anylinkcss.htm and adjusting my browser to be small, and the example pushes it to the top. This happens in any browser I try.

    Thanks much!
    hanji

  2. #2
    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

    It is supposed to do that. What this feature is really intended for is if the menu is lower on the page and/or scrolled near the bottom of an adequately sized window. In cases like that it allows the menu to still be seen and used.

    But, if the browser window is too small, does it really matter where the drop down goes? The menu is still unusable.

    Your drop downs should be short enough to fit in about 350px height. That way they will still be usable at 800 x 600 resolution, and fine for all of today's more common monitor resolutions.

    However, if you still wish to disable this feature, find this function in the script file and comment out (red //) the highlighted lines as shown:

    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=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
    }
    Last edited by jscheuer1; 01-09-2009 at 06:20 PM. Reason: get that curly bracket
    - John
    ________________________

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

  3. #3
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello

    Thanks for the reply. I tried this, but I'm receiving an error now.

    Code:
    return not in function
    Odd thing is that edgeoffset is defined at the beginning of the function, so it should be able to return 0 there.

    Here is my function...

    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=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
    }
    Any ideas?
    hanji

  4. #4
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I see the issue. Needed to comment out that curly `}` bracket. It's working now.

    Thanks!
    hanji

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
  •