Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:12

Problem with divhider.js


Poster: rmamidipally
Dated: Wednesday March 1 2006 - 7:39:51 GMT

Hi,
I am using a licenced version of Milonic menu.

I am using divhider.js to solve the Select Box problem.

But, the problem is ..

I have 5 menus in the menu pad.

1 2 3 4 5

I have to hide the <div> when the mouse pointer is on 2 or 4.
Till here it is fine. But when I am moving to any other menu from 2 or 4 with out taking the mouse out of the menu pad, the <div> is being hided for the other menus also, which should not be.

It is working fine if I take the mouse pointer out of the menu pad and goes on again.


Please help me.

Thanks,
Ravi.


Poster: Andy
Dated: Wednesday March 1 2006 - 11:05:21 GMT

Hi,

Do you have a URL that we can see, this will help us a lot.

Cheers,
Andy


Poster: rmamidipally
Dated: Wednesday March 1 2006 - 12:39:03 GMT

Hi Andy,

The problem I am facing is in a site (http://www.myuhc.com) which is in production.And I am giving support for the same.That is why I can not provide you the URL where I am facing the problem.If required I can give you the licence number.
Otherwise, can I send you the screen shot? so that you can visualise the problem.


Please help me in solving teh problem.

Thanks,
Ravi.


Poster: John
Dated: Wednesday March 1 2006 - 13:59:25 GMT

Unfortunately none of your suggestions will help us. Next best is to post all your code here - don't forget to use the code /code tags. We'll need your HTML, -data file, and the exact versions of both the menu and divhider codes.


Poster: rmamidipally
Dated: Thursday March 2 2006 - 7:16:55 GMT

Hi,

I am sending the code for teh requested files.
Please let me know if you have any queries and help me soon in solving the problem.

Thanks,
Ravi.

HTML File

Code:
<% __at__ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<% __at__ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<% __at__ taglib uri="/WEB-INF/tld/personalization.tld" prefix="psn" %>
<% __at__ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>

<c:set var="m" scope="page" value="${sessionScope.MenuBean}"/>

<c:choose>
<c:when test="${empty m}">
   
</c:when>

<c:otherwise>


<bean:size id='mainMenuSize' name='m' property='parentMenuList' scope='page'/>

<fmt:setBundle basename="ApplicationResources"/>

<script type="text/javascript" src="/includes/dhtml/milonic_src.js"></script>
<script type="text/javascript" src="/includes/dhtml/divhider.js"></script>

<param copyright="JavaScript Menu by Milonic - http://www.milonic.com"></param>
<script   type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/includes/dhtml/mmenuns4.js><\/scr"+"ipt>");      
  else _d.write("<scr"+"ipt language=JavaScript src=/includes/dhtml/mmenudom.js><\/scr"+"ipt>");
-->
</script>
<script type="text/javascript" src="/includes/dhtml/menu_data.js"></script>   

<script type="text/javascript" >
   
with(menuStyle=new mm_style()){
<psn:str psnName="mainMenuStyle"/>
oncolor="<psn:str psnName='mainMenuItemMouseOverColor' />";
offcolor="<psn:str psnName='mainMenuItemMouseOffColor' />";
}

subMenuStyle=new copyOf(menuStyle);
<psn:str psnName="subMenuStyle"/>
   
<c:forEach items="${m.parentMenuList}" var="pMenu" varStatus="ists">
with(milonic=new menuname("<c:out value='${pMenu.menuName}'/>")){
style=subMenuStyle;
itemheight=20;
itemwidth=215;
align="left";
top=<psn:str psnName="subMenuTopPos"/>;
   <c:forEach items="${pMenu.subMenuItems}" var="subMenu" varStatus="jsts">
      <c:if test="${!subMenu.hiddenInMenu}">
aI("text=<psn:str psnName='underlineTag'/><fmt:message key='${subMenu.linkNameKey}'/>;valigh=middle;url=<c:out value='${subMenu.menuUrl}'/>;onbgcolor=<psn:str psnName='subMenuItemOverBackgroundColor' />;offbgcolor=<psn:str psnName='subMenuItemOffBackgroundColor' />;target=<c:out value='${subMenu.target}'/>;targetfeatures=<c:out value='${subMenu.targetFeatures}'/>;<c:out escapeXml='false' value='${subMenu.clickFunction}'/>");
      </c:if>         
   </c:forEach>
<psn:str psnName='menuSubBottom'/>
}
</c:forEach>
   
</script>

<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
   <tr><td class="menucellextendedbg" width="100%">
<SCRIPT TYPE="text/javascript">

//-- USER AGENT OBJECT

function clsUa(){
   this.ua=navigator.userAgent.toLowerCase();
   this.mac=(this.ua.indexOf("mac")!=-1);
   this.w3c=(document.getElementById)?1:0;
   this.ieX=(document.all)?1:0;
   this.ie5=(this.ieX && this.w3c)?1:0;
   if (!this.w3c) alert('\nYour browser may not be supported by this website.\n\nWe encourage you to upgrade.\n');
}

objUa = new clsUa();
var macIE5 = (objUa.ie5 && objUa.mac);

if (!macIE5) {      
   document.write('<table cellpadding="0" cellspacing="0" border="0" width="750" align="center">');
   document.write('<tr>');
   document.write('<td align="right" valign="top" class="mainmenu_leftconner">');
   document.write('<psn:img psnName="menuConnerLeftImg" />');
   document.write('</td>');
   document.write('<td align="left" valign="middle" class="mainmenu_tablecell" nowrap>');
   with(milonic=new menuname("Main Menu")){
   style=menuStyle;
   position="relative";
   alwaysvisible=1;
   orientation="horizontal";
   align="center";
   menuheight=31;
   itemheight=31;
   <c:forEach items="${m.parentMenuList}" var="pMenu" varStatus="ists">
   <c:if test="${!pMenu.hiddenInMenu}">   
   aI("text=<psn:str psnName='underlineTag'/><fmt:message key='${pMenu.linkNameKey}'/>;itemwidth=<c:out value='${pMenu.itemWidth}'/>;onbgcolor=<psn:str psnName='mainMenuItemOffBackgroundColor' />;offbgcolor=<psn:str psnName='mainMenuItemOverBackgroundColor' />;url=<c:out value='${pMenu.menuUrl}'/>;showmenu=<c:out value='${pMenu.menuName}'/>;");      
   </c:if>   
   </c:forEach>
   }
   drawMenus();      
   document.write('</td>');
   document.write('<td align="right" valign="top" class="mainmenu_rightconner">');
   document.write('<psn:img psnName="menuConnerRightImg" />');
      
   document.write('</td></tr></table>');
} else {
   document.write('<table  width="750" cellpadding="0" cellspacing="0" class="noscriptOutterTable" align="center">');
   document.write('<tr><td width="100%">');
   document.write('<table cellpadding="0" cellspacing="0" border="0" width="748">');
   document.write('<tr>');
   document.write('<td width="20" valign="top" class="mainmenu_leftconner">');
   document.write('<psn:img psnName="menuConnerLeftImg" /></td>');

   <c:forEach items="${m.parentMenuList}" var="pMenu" varStatus="ists">
      <c:if test="${!pMenu.hiddenInMenu}">
      document.write('<td align="center" valign="middle" class="noscriptnavbar" width="<c:out value='${pMenu.itemWidth}'/>" height="33" nowrap>');         
      document.write('<a href="<c:out value='${pMenu.menuUrl}'/>" class="noscriptlink"><fmt:message key="${pMenu.linkNameKey}"/></a>');
      document.write('</td>');   
      <c:if test="${ ists.index < mainMenuSize -1 }">
      document.write('<td class="noscriptnavbar" width="1">');
      document.write('<psn:img psnName="menuDividerImage"></psn:img>');
      document.write('</td>');
      </c:if>   
      </c:if>
   </c:forEach>
   document.write('<td width="80%" class="noscriptnavbar">&nbsp;</td>');

   document.write('<td align="right" valign="top" class="mainmenu_rightconner">');
   document.write('<psn:img psnName="menuConnerRightImg" />');
      
   document.write('</td></tr></table>');
   document.write('</td></tr></table>');      
}
   

</SCRIPT>         
<noscript>
<table  width="750" cellpadding="0" cellspacing="0" class="noscriptOutterTable" align="center">
   <tr><td width="100%">
<table cellpadding="0" cellspacing="0" border="0" width="748">
   <tr>
      <td width="20" valign="top" class="mainmenu_leftconner">      
            <psn:img psnName="menuConnerLeftImg" /></td>
      <c:forEach items="${m.parentMenuList}" var="pMenu" varStatus="ists">
         <c:if test="${!pMenu.hiddenInMenu}">
         <td align="center" valign="middle" class="noscriptnavbar" width="<c:out value='${pMenu.itemWidth}'/>" height="33" nowrap>         
            <a href="<c:out value='${pMenu.menuUrl}'/>" class="noscriptlink"><fmt:message key='${pMenu.linkNameKey}'/></a>
         </td>
         <c:if test="${ ists.index < mainMenuSize -1 }">
            <td class="noscriptnavbar" width="1">
            <psn:img psnName="menuDividerImage"></psn:img>
            </td>
         </c:if>   
         </c:if>
      </c:forEach>
      <td width="80%" class="noscriptnavbar">&nbsp;</td>
      <td align="right" valign="top" class="mainmenu_rightconner">
         <psn:img psnName="menuConnerRightImg" /></td>
   </tr>
   </table>
   </td>
   </tr>
</table>
</noscript>

</td></tr></table>
<%--style type="text/css">
<!-- This is a part to provide sitemap links inside & hidden in the menu tile.
It may be needed for future testing purpose. (Jason R.3.8 12/07/2004) -->
<!--
.hiddenSiteMapLayer {visibility:hidden;z-index:999999;position:absolute;top:0px;left:0px;width:600px;height:300px}
-->
</style>
<div id="hiddenSiteMap" class="hiddenSiteMapLayer"><jsp:include page="siteMapTile.jsp" /></div--%>

</c:otherwise>
</c:choose>



-data File

Code:
_menuCloseDelay=100           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=250          // The time delay before menus open on mouse over
_subOffsetTop=0             // Sub menu top offset (except the first level of sub menu)
_subOffsetLeft=0           // Sub menu left offset (except the first level of sub menu)

_W.ignoreCollisions=0
_CFix=true



divhider.js


Code:
/*
   Milonic DHTML Menu Object Hiding Module divhider.js version 1.0 - November 3 2004
   This module is only compatible with the Milonic DHTML Menu version 5.16 or higher

   Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
   This is a commercial software product, please visit http://www.milonic.com/ for more information.
*/

// The idea is to declare the HTML Object you need to hide when a menu becomes visible
// Declare the Menu Name -> Object Reference followed by a semi colon
// M_hideMenus Syntax: "MenuName->ObjectReference;";

M_hideMenus = "Samples->formdiv1;milonic->formdiv1;"

function M_hideLayer(_mnu,_show){
   if(op7||ie55||ns6||ns7)return
   M_hdar=M_hideMenus.split(";")
   for(_Ma=0;_Ma<M_hdar.length;_Ma++){
      M_hdarI=M_hdar[_Ma].split("->")
      M_mnu=getMenuByName(M_hdarI[0])
      if(M_mnu>-1&&M_mnu==_mnu){
         M_gm=gmobj(M_hdarI[1])
                     
         if(_show){
            if(ns4)M_gm.visibility="hide"; else M_gm.style.visibility="hidden"
         }
         else{
            if(ns4)M_gm.visibility="show"; else M_gm.style.visibility="visible"
         }      
      }
   }   
}


Thanks,
Ravi


Poster: rmamidipally
Dated: Monday March 6 2006 - 11:51:36 GMT

I have copied the code files.
Please look in to the problem and help me in finding the solution.
Please let me know if you need any more clarifications.

Thanks,
Ravi.