Results 1 to 7 of 7

Thread: AnyLink Dropdown Menu

  1. #1
    Join Date
    Jul 2005
    Posts
    222
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question AnyLink Dropdown Menu

    The page I will be referring to is japantown.awardspace.com/japantown.shtml

    When I use FF in a browser resolution of 800x600, it is impossible to get the "Other" menu to drop down.

    Although, in IE it drops down in 800x600, just a little off position to fit inside the screen I am guessing.

    In FF and IE the "Other" menu drops down fine in a browser resolution of 1024x768.

    How can I make it drop down correctly in FF in a browser resolution of 800x600?

    Oh! I also noticed that if the window is too small to let the menu drop down normally, it wont drop down at all. It attempts to, but it doesn't work. Is their a way to fix this?
    Last edited by Johnnymushio; 07-16-2006 at 10:33 PM. Reason: Oh!
    My Web Site
    Japan Town

  2. #2
    Join Date
    Jul 2005
    Posts
    222
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default

    bumpp
    My Web Site
    Japan Town

  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

    Due to the complexity and/or vagaries of your layout, the function clearbrowseredge(obj, whichedge) just doesn't seem to be working. In IE at 800X600 it makes no adjustment, in FF much too great of one in the opposite direction and in Opera, the adjustment appears about right but, inappropriate for your layout. So, I would suggest sort circuiting that function by assigning its return value to 0. Change it at the end as shown below in red:

    Code:
    function clearbrowseredge(obj, whichedge){
    var edgeoffset=0
    if (whichedge=="rightedge"){
    var windowedge=ie4 && !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=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
    var windowedge=ie4 && !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 0
    }
    - John
    ________________________

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

  4. #4
    Join Date
    Jul 2005
    Posts
    222
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default

    it worked. thank you
    My Web Site
    Japan Town

  5. #5
    Join Date
    Jul 2005
    Posts
    222
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question

    http://japantown.awardspace.com/japantown.shtml

    ok, im changing the pages width to 765, i dont plan on changing it again..

    but,, the menu is now going to be 152 pix long.

    i changed it, but the gray area is still 157 pix long, i believe thats the correct number.

    the highlight area and link area are 152, the correct size.

    how do i get rid of that extra gray area in the menu
    My Web Site
    Japan Town

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

    You've configured the style width to 152 (which to be effective should have units specified (added here in red):

    Code:
    #dropmenudiv a, span{
    color: black;
    width: 152px;
     . . .
    and the default width value in the script to 152px:

    Code:
    var menuwidth='152px' //default menu width
    but, in your individual onmouseover calls (example):

    Code:
    onMouseover="dropdownmenu(this, event, menu0, '159px')"
    in the area tags:

    Code:
    <map name="Map">
            <area shape="rect" coords="1,63,152,84" href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu0, '159px')" onMouseout="delayhidemenu()">
            <area shape="rect" coords="154,63,305,84" href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '159px')" onMouseout="delayhidemenu()">
            <area shape="rect" coords="307,63,458,84" href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, '159px')" onMouseout="delayhidemenu()">
            <area shape="rect" coords="460,63,611,84" href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu3, '159px')" onMouseout="delayhidemenu()">
            <area shape="rect" coords="613,63,764,84" href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu4, '159px')" onMouseout="delayhidemenu()">
            <area shape="rect" coords="50,15,265,50" href="japantown.shtml">
          </map>
    You've left it at 159px. I think you can use empty single quotes and it will follow the defaults. If not, setting each one to 152px should certainly get you that dimension. Example onmouseover event with empty single quotes for the width:

    Code:
    onMouseover="dropdownmenu(this, event, menu4, '')"
    - John
    ________________________

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

  7. #7
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Quote Originally Posted by >^o^>Johnnymushio<^o^<
    bumpp
    ...Huh?
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

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
  •