Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I Make My Menu Stay Put?

    I am having trouble with a menu placement.

    This is the page I'm trying to put the menu on:
    http://www.guitarpartsresource.com/g..._coolmenu2.htm


    This is the example i'm drawing from:
    http://www.guitarpartsresource.com/c...lacement1.html

    In the original one, it's positioned to the left, but I need it on the right, within the black area. I am having trouble making it stay where it is when the window is resized, refreshed, screen resolution changed, etc. Is there any way I can make it stay where I want it?

    I tried to go back to the website where i got the scripts: dhtmlcentral.com for help but it has vanished.

    Any idea what's going on?


  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,533
    Thanks
    3
    Thanked 512 Times in 499 Posts
    normally if the menu has absolue positioning, position the menu at anchor point coordinates <a id="MyAnchor" ></a>
    and reposition at anchor when resizing

    Have not unraveled the specific code but would hope that the submenus are relative to the menu.

    problem is identifying the menu object.

  • #3
    New to the CF scene
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i forgot to include the relevant bit of code:

    //Menu object creation
    oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

    //Menu properties
    oCMenu.pxBetween=0
    //Using the cm_page object to place the menu ----
    //There are some differences between the browsers that I try to fix here.
    oCMenu.fromLeft=!bw.ns4?cmpage.x2 - 950:cmpage.x2 - 740
    //We also need to "replace" the menu on resize. So:
    oCMenu.onresize="oCMenu.fromRight=cmpage.x2 - 24"


    oCMenu.fromTop=193
    oCMenu.rows=0
    oCMenu.menuPlacement=0


    oCMenu.offlineRoot="file:///C|/Inetpub/wwwroot/dhtmlcentral/projects/coolmenus/examples/"
    oCMenu.onlineRoot="/coolmenus/"
    oCMenu.resizeCheck=1
    oCMenu.wait=1000
    oCMenu.fillImg="cm_fill.gif"
    oCMenu.zIndex=0

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,533
    Thanks
    3
    Thanked 512 Times in 499 Posts
    put an onload event call to function Test()

    example

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    function Test(){
     alert(document.getElementById('oCMenu').offsetLeft+'\n'+document.getElementById('oCMenu').offsetTop);
    
    }
    //-->
    </script>
    </head>
    
    <body onload="Test();">
    
    </body>
    
    </html>
    if answer not sensible you will need to read the script help files

  • #5
    New to the CF scene
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That helped some, thanks! I'm still having some problems though...

    1. If the window is resized and then refreshed the menu disappears.
    2. It doesn't show up at all in the 800 x 600 resolution.

    I'm not sure which set of numbers to set to which position

    my page:

    oCMenu.fromLeft=!bw.ns4?cmpage.x2 - 950:cmpage.x2 - 740
    //We also need to "replace" the menu on resize. So:
    oCMenu.onresize="oCMenu.fromRight=cmpage.x2 - 24"


    the example page:

    oCMenu.fromLeft=!bw.ns4?cmpage.x2 - 160:cmpage.x2 - 176
    //We also need to "replace" the menu on resize. So:
    oCMenu.onresize="oCMenu.fromLeft=cmpage.x2 - 160"


  •  

    Posting Permissions

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