Submenu's appear at the top of the page

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Martyzz1
Beginner
Beginner
Posts: 2
Joined: Tue Jun 10, 2003 2:29 pm

Submenu's appear at the top of the page

Post by Martyzz1 »

Hi,

I've got an issue whereby my submenus are appearing at the top of the page, not next to the submenu link in the parent menu.
Currently my top menus are set to appear when you click on the Admin link, or the Reconciler link in the top corners of the screen. I use the same menu class for each menu, is this correct, or should submenu's be given a different class?

Regards

Marty

I can't give you a URL, but I can attach a HTML file.

Code: Select all

<html>
  <head>
    <link rel="stylesheet"  href="/stylesheets/classes.css" type="text/css">
    <script language=JavaScript src="milonic_src.js" type=text/javascript></script>
    <title class="MainPageTitle">Financial Period Admin</title>
  </head>

  <body class="body">
  <table align="center" class="MainTable" width=440>
  <tr>
    <table class="FrameworkMenu" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
  <td width="200">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>
        
            <SCRIPT language=javascript>
_scrollAmount=3      // Used for Netscape 4 scrolling
_scrollDelay=20      // Used for Netscape 4 scrolling

_menuCloseDelay=500  // The delay for menus to remain visible on mouse off
_menuOpenDelay=150   // The delay for opening menus on mouse over
//_followSpeed=0       // Follow Scrolling speed (higher number makes the scrolling smoother but slower)
//_followRate=0        // Follow Scrolling Rate (use a minimum of 40 or you may experience problems)
_subOffsetTop=0;     // Sub menu offset Top position
_subOffsetLeft=0;  // Sub menu offset Left position


with(mainStyle=new mm_style()){
     onbgcolor = "#6699cc";
       oncolor = "#00ffff";
    offbgcolor = "#3366cc";
      offcolor = "#ffff66";
   bordercolor = "black";
   borderstyle = "solid";
separatorcolor = "black";
 separatorsize = 1;
       padding = 4
       onborder="2px solid black"
      fontsize = "55%";
     fontstyle = "normal";
    fontweight = "normal";
    fontfamily = "verdana, tahoma, arial";
   high3dcolor = null; // Not sure if this will be included in final release
    low3dcolor = null; // Not sure if this will be included in final release
     pagecolor = "purple";
   pagebgcolor = "pink";
   topbarimage = "/images/menu/arrow_down.gif";
topbarimageloc = "center;middle"
      subimage = "/images/menu/arrow.gif";
   subimageloc = "center;middle"
  //ondecoration = "underline"
  //onbold = true;
  //onitalic = true;
}



with(milonic=new menuname("Admin")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Administration Screen;showmenu=Bficient::Admin::Apache");
    
  
    
  aI("text=User Administration;showmenu=Bficient::Admin::Apache::User");
    
  
    
  aI("text=Group Administration;showmenu=Bficient::Admin::Apache::Group");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Administration Menu;url=/admin/show_main_menu/");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::User")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=User Plugin Administration;showmenu=Bficient::Admin::Apache::User::Administration");
    
  
    
  aI("text=Create User;url=/admin/user/create_user_form/");
    
  
    
  aI("text=View User;url=/admin/user/select_user_form/");
    
  
    
  aI("text=Edit User;url=/admin/user/select_user_form/");
    
  
    
  aI("text=Set Password;url=/admin/user/select_user_form/");
    
  
    
  aI("text=Delete User;url=/admin/user/select_user_form/");
    
  
    
  aI("text=User Plugin Authorisation;showmenu=Bficient::Admin::Apache::User::Authorisation");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::User::Authorisation")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Edit User Plugin Access Rights;url=/admin/user/authorisation/select_form/");
    
  
    
  aI("text=View User Plugin Authorisations;url=/admin/user/authorisation/select_form/");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::User::Administration")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Edit User Plugin Administration Rights;url=/admin/user/administration/select_form/");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::Group")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Create Group;url=/admin/group/create_group_form/");
    
  
    
  aI("text=View Group;url=/admin/group/select_group_form/");
    
  
    
  aI("text=Edit Group;url=/admin/group/select_group_form/");
    
  
    
  aI("text=Delete Group;url=/admin/group/select_group_form/");
    
  
    
  aI("text=Group Users Administration;showmenu=Bficient::Admin::Apache::Group::Users");
    
  
    
  aI("text=Group Plugin Authorisation;showmenu=Bficient::Admin::Apache::Group::Authorisation");
    
  
    
  aI("text=Group Plugin Administration;showmenu=Bficient::Admin::Apache::Group::Administration");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::Group::Users")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=View Group Users;url=/admin/group/users/select_group_form/");
    
  
    
  aI("text=Manage Group Members;url=/admin/group/users/select_group_form/");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::Group::Authorisation")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Edit Group Plugin Access Rights;url=/admin/group/authorisation/select_form/");
    
  
    
  aI("text=View Group Plugin Authorisations;url=/admin/group/authorisation/select_form/");
    
  
}


with(milonic=new menuname("Bficient::Admin::Apache::Group::Administration")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Edit Group Plugin Administration Rights;url=/admin/group/administration/select_form/");
    
  
}


for(_a=_mnucnt;_a<_m.length;_a++){_drawMenu(_a)}
</SCRIPT>

  <a href="/admin/"><center><img src="/images/Admin/admin_highlighted.gif" width="40" height="40" border=0 alt=Admin><br></a><a href="javascript:popup('Admin',1)" onmouseout=popdown("Admin")>Admin</a>

        
      </td>
    </tr>
    <tr>
      <td class="MainTableCell">Welcome <a href="/admin/user/edit_user_form/58">Admin User</a></td>
    </tr>
    <tr>
      <td class="MainTableCell"><a href="#" onClick="if (confirm('Are you Sure you want to Signout Admin?')) document.location.href='/logout/';return false;">(Sign Out)</a></td>
    </tr>
    </table>
  </td>


  
  <td>
    
    
      <SCRIPT language=javascript>
_scrollAmount=3      // Used for Netscape 4 scrolling
_scrollDelay=20      // Used for Netscape 4 scrolling

_menuCloseDelay=500  // The delay for menus to remain visible on mouse off
_menuOpenDelay=150   // The delay for opening menus on mouse over
//_followSpeed=0       // Follow Scrolling speed (higher number makes the scrolling smoother but slower)
//_followRate=0        // Follow Scrolling Rate (use a minimum of 40 or you may experience problems)
_subOffsetTop=0;     // Sub menu offset Top position
_subOffsetLeft=0;  // Sub menu offset Left position


with(mainStyle=new mm_style()){
     onbgcolor = "#6699cc";
       oncolor = "#00ffff";
    offbgcolor = "#3366cc";
      offcolor = "#ffff66";
   bordercolor = "black";
   borderstyle = "solid";
separatorcolor = "black";
 separatorsize = 1;
       padding = 4
       onborder="2px solid black"
      fontsize = "55%";
     fontstyle = "normal";
    fontweight = "normal";
    fontfamily = "verdana, tahoma, arial";
   high3dcolor = null; // Not sure if this will be included in final release
    low3dcolor = null; // Not sure if this will be included in final release
     pagecolor = "purple";
   pagebgcolor = "pink";
   topbarimage = "/images/menu/arrow_down.gif";
topbarimageloc = "center;middle"
      subimage = "/images/menu/arrow.gif";
   subimageloc = "center;middle"
  //ondecoration = "underline"
  //onbold = true;
  //onitalic = true;
}



with(milonic=new menuname("Reconciler")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Entity Admin;showmenu=Bficient::Reconciler::Apache::Admin::Entity");
    
  
    
  aI("text=Financial Period Admin;showmenu=Bficient::Reconciler::Apache::Admin::FinancialPeriod");
    
  
    
  aI("text=Reporting Hierarchies;showmenu=Bficient::Reconciler::Apache::Admin::Hierarchy");
    
  
}


with(milonic=new menuname("Bficient::Reconciler::Apache::Admin::Hierarchy")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Create Hierarchy Level;url=/admin/reconciler/hierarchy/create_form/");
    
  
    
  aI("text=Delete Hierarchy Level;url=/admin/reconciler/hierarchy/select_form/");
    
  
    
  aI("text=Edit Hierarchy Levels;url=/admin/reconciler/hierarchy/select_form/");
    
  
    
  aI("text=View Hierarchy Levels;url=/admin/reconciler/hierarchy/select_form/");
    
  
    
  aI("text=Hierarchy Relationship;showmenu=Bficient::Reconciler::Apache::Admin::Hierarchy::Relationship");
    
  
}


with(milonic=new menuname("Bficient::Reconciler::Apache::Admin::Entity")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Create Entity Level;url=/admin/reconciler/entity/create_form/");
    
  
    
  aI("text=Delete Entity Level;url=/admin/reconciler/entity/select_form/");
    
  
    
  aI("text=Edit Entity Levels;url=/admin/reconciler/entity/select_form/");
    
  
    
  aI("text=View Entity Levels;url=/admin/reconciler/entity/select_form/");
    
  
    
  aI("text=Entity Relationship;showmenu=Bficient::Reconciler::Apache::Admin::Entity::Relationship");
    
  
}


with(milonic=new menuname("Bficient::Reconciler::Apache::Admin::FinancialPeriod")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Create Financial Period;url=/admin/reconciler/financialperiod/create_form/");
    
  
    
  aI("text=Delete Financial Period;url=/admin/reconciler/financialperiod/select_form/");
    
  
    
  aI("text=View Financial Periods;url=/admin/reconciler/financialperiod/select_form/");
    
  
}


with(milonic=new menuname("Bficient::Reconciler::Apache::Admin::Entity::Relationship")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Add Child;url=/admin/reconciler/entity/relationship/select_form/");
    
  
    
  aI("text=Remove Child;url=/admin/reconciler/entity/relationship/select_form/");
    
  
    
  aI("text=View Relationships;url=/admin/reconciler/entity/relationship/select_form/");
    
  
}


with(milonic=new menuname("Bficient::Reconciler::Apache::Admin::Hierarchy::Relationship")){_c=1
top = 1;
//left = -30;
//itemwidth=60
//menuwidth="99%";
borderwidth = 1;
//screenposition = "center;middle";
//alignment="center";
style = mainStyle;
//alwaysvisible = 0;
//orientation="vertical"
//filter = null;
//followscroll = null;
//keepalive = 1;
//overallwidth = null;
//righttoleft = null;
//itemheight=200;
//openonclick = true;
//bgimage="winxp_back.gif";
//position="relative";
//separatorcolor="green";
overflow="scroll";

  
    
  aI("text=Set Hierarchy Account Number;url=/admin/reconciler/hierarchy/relationship/select_form/");
    
  
    
  aI("text=Add Child;url=/admin/reconciler/hierarchy/relationship/select_form/");
    
  
    
  aI("text=Remove Child;url=/admin/reconciler/hierarchy/relationship/select_form/");
    
  
    
  aI("text=Edit Relationships Form;url=/admin/reconciler/hierarchy/relationship/select_form/");
    
  
    
  aI("text=View Relationships;url=/admin/reconciler/hierarchy/relationship/select_form/");
    
  
}


for(_a=_mnucnt;_a<_m.length;_a++){_drawMenu(_a)}
</SCRIPT>

  <a href="/private/reconciler"><center><img src="/images/Reconciler/reconciler.gif" width="40" height="40" border=0 alt=Mailer><br></a><a href="javascript:popup('Reconciler',1)" onmouseout=popdown("Reconciler")>Reconciler</a></center>

    
  </td>

</tr>
<tr>
  <td nowrap width="100%" background="/images/FrameWork/bottom_shadow2.jpg" valign="top" colspan="10">

      <table width="100%" border="0" cellspacing="0" cellpadding="0" background="/images/FrameWork/bottom_shadow2.jpg">
        <tr>
          <td><img src="/images/FrameWork/bottom_shadow.jpg" width="43" height="9"></td>
        </tr>
      </table>


    </td>
</tr>
</table>

  </tr>
  
  <script>
    defaultStatus="Ok";
  </script>
  
  <tr>
    <td>
      <table class="MainPageTable" align="center">
      <tr>
        <td align="center" class="MainPageTitle"><a href="/admin/reconciler/financialperiod/">Financial Period Admin</a></td>
      </tr>
      <tr>
        <td align="center" class="MainPageSubTitle">Financial Period Admin</td>
      </tr>
      <tr>
        <td>
            <table align="center" borderwidth="0" cellpadding="2" class="MainTable">
  <tr>
    <td>
      <form method="POST" action="/admin/reconciler/financialperiod/" name="select_form">
      <table align="center" borderwidth="0" cellpadding="2" class="MainTable">
      <input type="hidden" name="task" value="view_form">
      <tr>
        <td class="MainTableCell">
          <SELECT name="chosen_period_id" id="chosen_period_id" size="1">
             
            <OPTION value="4">Period 1 (19/06/2003 - 19/06/2003)</OPTION>
             
            <OPTION value="5">Period 2 (19/06/2003 - 19/06/2003)</OPTION>
            
          </SELECT>
        </td>
      </tr>
      <tr>
        <td class="MainTableCell"> 
          <table align="center" borderwidth="0" cellpadding="2" class="MainPageTable">
          <tr>
          
            <td>
              <a href="#" onClick="document.location.href='/admin/reconciler/financialperiod/view_form/' + document.select_form.chosen_period_id.value;return false"><img src="/images/icons/blue_view_button.gif" border="0"></a>
            </td>
          
          
            <td>
              <A href="#" onClick="if (confirm('Are you Sure you want to delete The Selected Financial Period?')) document.location.href='/admin/reconciler/financialperiod/delete/' + document.select_form.chosen_period_id.value;return false"><img src="/images/icons/blue_delete_button.gif" align="center" border="0"></A>
            </td>
          
          
            <td>
              <A href="#" onClick="document.location.href='/admin/reconciler/financialperiod/create_form/';return false"><img src="/images/icons/blue_create_button.gif" align="center" border="0"></A>
            </td>
          
          </tr>
          </table>
        <td>
      </tr>
      </table>
      </form>
    </td>
  </tr>
  </table>

        </td>
      </tr>
      </table>
    </td>
  </tr>
  </table>
  </body>
</html>

Martyzz1
Beginner
Beginner
Posts: 2
Joined: Tue Jun 10, 2003 2:29 pm

Solved - But weird

Post by Martyzz1 »

I solved the issu by uncommenting out the following line, but leaving it set to a null value.

Code: Select all

screenposition = "";
arty
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Your problem lies in the way you declare your menus. All of your menus have a

Code: Select all

top = 1; 
declaration. You should only have this line in menus that you want to be absolutely positioned on the page. What you are doing with your current setup is telling each and every menu to render itself 1 pixel away from the top of the screen. Take out that line for any menus that are 'children' menus. That should fix your problem.

If you want the menus to be slightly offset from their parents, you can change your top value to say

Code: Select all

top = "offset=5"; 
which will push the menu 5 pixels lower than the parent, kinda XP-ish.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply