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:04

Problems with submenu widths IN NS7.1


Poster: mckee __at__ newsstand.com
Dated: Monday October 13 2003 - 18:38:19 BST

After installing RC 17 I am having a problem with submenus being much wider than they should be. If I strip the code down to just the menu stuff everything is fine so clearly a large portion of the problem lies in my code. The question is what changed between RC 15 and RC 17 that deals with submenu widths in NS 7.x so that I might be able to see what portion of my code is offending.

Thanks,

Shawn
http://www.newsstand.com


Poster: John
Dated: Monday October 13 2003 - 21:48:39 BST

RC16 (I think) corrected a number of items concerned with NS display.

Post a URL.


Poster: mckee __at__ newsstand.com
Dated: Wednesday October 15 2003 - 20:55:41 BST

Well I was trying RC 17 so I assume fixes in 16 would be there. I can't post a URL as the site is in development and not publically accessable. What I experienced sounds a lot like what I have seen others post about RC 15.

A screen shot can be found here.

http://static.newsstand.com/milonic.jpg


Poster: John
Dated: Wednesday October 15 2003 - 22:00:47 BST

Post your data.js file here. Use the code tag when posting it.


Poster: mckee __at__ newsstand.com
Dated: Wednesday October 15 2003 - 23:03:31 BST

Four things to keep in mind.
1) it works fine with RC 15
2) large portions of this are generated dynimcally using ColdFusion so you are seeing a mix of JS and CFML in here.
3) The equivalent of the data.js file begins after this:
if(oANSRecog)
4) If I run this by itself outside of the surrounding CFML that actually builds the page it appears to function just fine. This is why I asked about what changed between 15 and 17 in the belief that there must be a collision of some sort between my code and the Milonic code.

Code:
<cfif NOT isDefined("client.showText")>
   <cfset client.showText = true>
</cfif>

<cfif isDefined("attributes.showText")>
   <cfset client.showText = attributes.showText>
</cfif>
<cfif client.showTB>
   <cfoutput>
      <script language="JavaScript" type="text/javascript">
      //==================================================================
      var nsrChek;
      nsrChek = 0; // Note: Non-zero values are error values
      var oANSRecog;
      oANSRecog = null;
   
      var userName;
      var userGUID;
      var acroChek;
      var error;
      var newIDR;
      var launchRC;
      var launchRCStr;
      var nsrVersion;
      var setUPResult;
   
      error = "none";
      userName = "";
      userGUID = "";
      acroChek = 1; // Note: Non-zero values are error values
      newIDR = 0; // Note: Non-zero values are error values
      launchRC = 0; // Note: Non-zero values are error values
      launchRCStr = ""; // Note: Non-empty values are error values
      nsrVersion = "";
      setUPResult = ""; // Note: 0 = values unchanged, 1 = values set
   
      function InitPage()
      {
        try
         {
            if (window.ActiveXObject)
            {
              oANSRecog = new ActiveXObject( "ANSRecog.IERecog.1" );
             
            }
            else if (window.GeckoActiveXObject)
            {
              oANSRecog = new GeckoActiveXObject( "ANSRecog.IERecog.1" );
            }
     
            try
            {
               acroChek   = oANSRecog.CheckForAcrobat(); // Note: Non-zero values are error values
               nsrChek      = oANSRecog.CheckForReader();  // Note: Non-zero values are error values
               userName   = oANSRecog.GetReaderUserName();
               userGUID   = oANSRecog.GetReaderGUID();
               nsrVersion   = oANSRecog.GetVersion();
            }
            catch ( exception )
            {
               error = "API";
               oANSRecog = null;
            }
         }
         catch ( exception )
         {
            error = "object";
            oANSRecog = null;
         }
     
         if (error == "none")
            return  (oANSRecog != null) //&& (value == 0) ); // return 'true' if object found and functional
     
      }
     
      function doDownload( issID )
      {
         if (nsrChek == 0)
         {
            launchRC = oANSRecog.StartReaderDownload( issID );
         }
      }
      function doReaderWebCommand( cmd, arg )
      {
               if (nsrChek == 0)
               {
                  launchRC = oANSRecog.NSWebCmd( cmd, arg );
               }
      }
     function setUsernamePass( Frm )
     {
      setUPResult = oANSRecog.SetUserNamePass( Frm.username.value, Frm.pword.value );
     }

     function viewIssue( Frm )
     {
      if (Frm.issueID.value != "")
      {
         launchRC = oANSRecog.NSWebCmd( "ViewIssue", Frm.issueID.value );
      }
     }

     function searchIssues( Frm )
     {
      if (Frm.searchArg.value == "")
      {
         launchRC = oANSRecog.NSWebCmd( "Search", "" );
      }
      else
      {
         launchRC = oANSRecog.NSWebCmd( "Search", Frm.searchArg.value );
      }
     }
    
      InitPage();

      if(oANSRecog)
      {
         _menuCloseDelay=500           // The time delay for menus to remain visible on mouse out
         _menuOpenDelay=150            // The time delay before menus open on mouse over
         _followSpeed=5                // Follow scrolling speed
         _followRate=40                // Follow scrolling Rate
         _subOffsetTop=5              // Sub menu top offset
         _subOffsetLeft=-10            // Sub menu left offset
         var showText = #client.showText#;
         var showTB = #client.showTB#;
         
         
         with(menuStyle=new mm_style())
         {
            onbgcolor="lightgrey";
            oncolor="black";
            offbgcolor="lightgrey";
            offcolor="black";
            bordercolor="##296488";
            borderstyle="solid";
            borderwidth=1;
            separatorcolor="##2D729D";
            separatorsize="1";
            padding=5;
            fontsize="75%";
            fontstyle="normal";
            fontfamily="Verdana, Tahoma, Arial";
            pagecolor="black";
            headercolor="##000000";
            headerbgcolor="##ffffff";
            subimage="#attributes.images#/T_arrow.gif";
            subimagepadding="2";
            overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='##777777', Direction=135, Strength=5)";
            outfilter="randomdissolve(duration=0.3)";
         }
         with(menuStyle2=new mm_style())
         {
            onbgcolor="lightgrey";
            oncolor="black";
            offbgcolor="lightgrey";
            offcolor="black";
            bordercolor="##296488";
            borderstyle="solid";
            borderwidth=1;
            separatorcolor="lightgrey";
            separatorsize="1";
            padding=5;
            fontsize="75%";
            fontstyle="normal";
            fontfamily="Verdana, Tahoma, Arial";
            pagecolor="black";
            headercolor="##000000";
            headerbgcolor="##ffffff";
            subimage="#attributes.images#/arrow.gif";
            subimagepadding="2";
            overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='##777777', Direction=135, Strength=5)";
            outfilter="randomdissolve(duration=0.3)";
         }
         
         with(milonic=new menuname("Issues"))
         {
            style=menuStyle;
            top=0;
            left=0;
            alwaysvisible=1;
            orientation="horizontal";
            followscroll="1";
            if(showText)
            {
               itemwidth="100%";
               aI("image=#attributes.images#/ns-icon1.jpg;text=NewsStand;url=#attributes.standardURL#;status=NewsStand;");
               aI("image=#attributes.images#/pref1.jpg;text=#getTrans("PREFERENCES", int(static.langid))#;showmenu=Prefs;status=#getTrans("PREFERENCES", int(static.langid))#;");
               <cfif isDefined("client.cust_id")>
                  aI("image=#attributes.images#/search1.jpg;text=#getTrans("SEARCH", int(static.langid))#;showmenu=Search;status=#getTrans("SEARCH", int(static.langid))#;");
                  aI("image=#attributes.images#/paper.jpg;text=Issues;showmenu=Pubs;statu=My Publications;");
                  aI("image=#attributes.images#/alert1.jpg;text=Alerts;showmenu=Alerts;statu=Alerts;");
               </cfif>
               aI("image=#attributes.images#/help1.jpg;text=#getTrans("HELP", int(static.langid))#;url=http://support.newsstand.com;target=_blank;status=Help;");
            }
            else
            {
               aI("image=#attributes.images#/ns-icon1.jpg;url=#attributes.standardURL#;status=NewsStand;");
               aI("image=#attributes.images#/pref1.jpg;showmenu=Prefs;status=#getTrans("PREFERENCES", int(static.langid))#;");
               <cfif isDefined("client.cust_id")>
                  aI("image=#attributes.images#/search1.jpg;showmenu=Search;status=#getTrans("SEARCH", int(static.langid))#;");
                  aI("image=#attributes.images#/paper.jpg;showmenu=Pubs;statu=My Publications;");
                  aI("image=#attributes.images#/alert1.jpg;showmenu=Alerts;statu=Alerts;");
               </cfif>
               aI("image=#attributes.images#/help1.jpg;url=http://support.newsstand.com;target=_blank;status=Help;");
            }
         }
         
         <cfif isDefined("client.cust_id")>
               <cfquery name="getissuestitle" DATASOURCE="#dsn#">
                  SELECT
                     cd.pub_id, min(circulation_date) as start_date, max(circulation_date) as end_date, pm.pub_name, pub_ns_reader_life_span
                  FROM
                     circulation_detail cd, publication_master pm
                  WHERE
                     cd.cust_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#attributes.cust_id#"> and
                     cd.pub_id = pm.pub_id
                  GROUP BY cd.pub_id, pm.pub_id, pm.pub_name, pub_ns_reader_life_span
                  ORDER BY pub_name
               </cfquery>
         
            with(milonic=new menuname("Pubs"))
            {
               style=menuStyle2;
               overflow="scroll";
               <cfloop query="getissuestitle">
                  <cfset pn = replace(replace(pub_name, "'", "", "all"), " ", "", "all")>
                  aI("text=#pub_name#;showmenu=#pn#;status=#pub_name#;");
               </cfloop>
            }
            <cfif getissuestitle.recordCount GT 0>
               <cfloop query="getissuestitle">
                  <cfquery name="issues2" datasource="#dsn#" maxrows="8">
                     SELECT
                        *
                     FROM
                        circulation_detail
                     WHERE
                        cust_id = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#attributes.cust_id#"> AND
                        pub_id  = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#pub_id#">
                        <cfif pub_ns_reader_life_span GT 0>
                           <cfset variables.diff = "#dateFormat(dateAdd('s', -pub_ns_reader_life_span, now()), 'yyyymmdd')# #timeFormat(dateAdd('s', -pub_ns_reader_life_span, now()), 'HH:mm:ss')#">
                           AND circulation_date > to_date(<cfqueryparam cfsqltype="CF_SQL_CHAR" value="#variables.diff#">, 'yyyymmdd hh24:mi:ss')
                        </cfif>
                     ORDER BY
                        circulation_date desc
                  </cfquery>
                  <cfif issues2.recordCount GT 0>
                     <cfset pn = replace(replace(pub_name, "'", "", "all"), " ", "", "all")>
                     with(milonic=new menuname("#pn#"))
                     {
                        style=menuStyle;
                        <cfset variables.cnt = 0>
                        <cfloop query="issues2">
                           <cfif variables.cnt LT 7>
                              aI("text=#circulation_date#;url=javascript:doReaderWebCommand('ViewIssue', '#issue_id#')");
                              <cfset variables.cnt = variables.cnt + 1>
                           <cfelse>
                              aI("text=More;url=/index.cfm?fuseaction=downloadmgr;status=more");
                           </cfif>
                        </cfloop>
                     }
                  </cfif>
               </cfloop>
            </cfif>
            with(milonic=new menuname("Alerts"))
            {
               style=menuStyle;
               overflow="scroll";
               aI("text=Alerts would be displayed here;");
            }
         </cfif>
            with(milonic=new menuname("Prefs"))
            {
               style=menuStyle2;
               aI("text=#getTrans("EDITREADER", int(static.langid))#;showmenu=settings;status=Reader Settings;separatorcolor=##2D729D");
               aI("text=#getTrans("ACCOUNTINFO2", int(static.langid))#;url=/index.cfm?fuseaction=contactinfo;");
               aI("text=#getTrans("TRANSHISTORY", int(static.langid))#;url=/index.cfm?fuseaction=AccountSetting;separatorcolor=##2D729D");
               aI("image=#attributes.images#/S_checkmark.jpg;text=#getTrans("ICONSANDTEXT", int(static.langid))#;url=javascript:changeTextDisp();separatorcolor=##2D729D");
               aI("text=#getTrans("HELP", int(static.langid))#;url=http://support.newsstand.com;target=_blank;status=Help;");
               aI("text=#getTrans("KILLTOOLBAR", int(static.langid))#;url=javascript:disable();");
            }
         
            with(milonic=new menuname("settings"))
            {
               style=menuStyle;
               aI("text=Profile...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_PROFILE', '');");
               aI("text=Download...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_DOWNLOAD', '');");
               aI("text=Viewer...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_VIEWER', '');");
               aI("text=Media...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_MEDIA', '');");
               aI("text=General...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_GENERAL', '');");
               aI("text=Server...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_SERVER', '');");
               aI("text=eDM Server...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_EDMSERVER', '');");
               aI("text=Message Manager...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_ME', '');");
               aI("text=Advanced...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_ADVANCED', '');");
            }
         
            with(milonic=new menuname("Search"))
            {
               style=menuStyle;
               aI("text=<FORM METHOD=GET ACTION=javascript:rdrSearch(this) name=search><table><tr><td><input name=q size=11></td></tr><tr><td><input type=submit value=#getTrans("SEARCH", int(static.langid))#></td></tr></table></form>;type=form;align=center");
            }   
         
         drawMenus();
         
            function rdrSearch(frm)
            {
               oANSRecog.NSWebCmd( "Search", frm.document.search.q.value);
            }
            function changeTextDisp()
            {
               var url = "#cgi.request_uri#";
               if(url.indexOf("?") == -1)
                  window.location.href=url+"?showText="+!showText;
               else if(url.indexOf("showText") == -1)
                  window.location.href=url+"&showText="+!showText;
               else if(url.indexOf("showText=false") > -1)
                  window.location.href=url.replace("showText=false", "showText=true");
               else
                  window.location.href=url.replace("showText=true", "showText=false");
            }
            function disable()
            {
               var url = "#cgi.request_uri#";
               if(url.indexOf("?") == -1)
                  window.location.href=url+"?showTB="+!showTB;
               else if(url.indexOf("showTB") == -1)
                  window.location.href=url+"&showTB="+!showTB;
               else if(url.indexOf("showTB=false") > -1)
                  window.location.href=url.replace("showTB=false", "showTB=true");
               else
                  window.location.href=url.replace("showTB=true", "showTB=false");
            }
         }     
      </script>
   </cfoutput>
</cfif>

[/code]


Poster: mckee __at__ newsstand.com
Dated: Wednesday October 22 2003 - 19:07:30 BST

Hello, anybody home? I posted the code, any ideas?


Poster: mckee __at__ newsstand.com
Dated: Wednesday October 22 2003 - 19:32:39 BST

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
   <head>
       <title>
           Menu Test
       </title>
   </head>
   <body leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" topmargin="0">
      <div align="center">
         <script language=JavaScript src="/js/milonic_src.js" type=text/javascript></script>
         <script language=JavaScript src="/js/mmenudom.js" type=text/javascript></script>
         <script language="JavaScript" type="text/javascript">
            _menuCloseDelay=500           // The time delay for menus to remain visible on mouse out
            _menuOpenDelay=150            // The time delay before menus open on mouse over
            _followSpeed=5                // Follow scrolling speed
            _followRate=40                // Follow scrolling Rate
            _subOffsetTop=5              // Sub menu top offset
            _subOffsetLeft=-10            // Sub menu left offset
            var showText = true;
            var showTB = true;
           
            with(menuStyle=new mm_style())
            {
               onbgcolor="lightgrey";
               oncolor="black";
               offbgcolor="lightgrey";
               offcolor="black";
               bordercolor="#296488";
               borderstyle="solid";
               borderwidth=1;
               separatorcolor="#2D729D";
               separatorsize="1";
               padding=5;
               fontsize="75%";
               fontstyle="normal";
               fontfamily="Verdana, Tahoma, Arial";
               pagecolor="black";
               headercolor="#000000";
               headerbgcolor="#ffffff";
               subimage="/images/T_arrow.gif";
               subimagepadding="2";
               overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
               outfilter="randomdissolve(duration=0.3)";
            }
            with(menuStyle2=new mm_style())
            {
               onbgcolor="lightgrey";
               oncolor="black";
               offbgcolor="lightgrey";
               offcolor="black";
               bordercolor="#296488";
               borderstyle="solid";
               borderwidth=1;
               separatorcolor="lightgrey";
               separatorsize="1";
               padding=5;
               fontsize="75%";
               fontstyle="normal";
               fontfamily="Verdana, Tahoma, Arial";
               pagecolor="black";
               headercolor="#000000";
               headerbgcolor="#ffffff";
               subimage="/images/arrow.gif";
               subimagepadding="2";
               overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
               outfilter="randomdissolve(duration=0.3)";
            }
   
            with(milonic=new menuname("Issues"))
            {
               style=menuStyle;
               top=0;
               left=0;
               alwaysvisible=1;
               orientation="horizontal";
               followscroll="1";
               if(showText)
               {
                  itemwidth="100%";
                  aI("image=/images/ns-icon1.jpg;text=NewsStand;url=http://mckeewwwn;status=NewsStand;");
                  aI("image=/images/pref1.jpg;text=Preferences;showmenu=Prefs;status=Preferences;");
                  aI("image=/images/help1.jpg;text=Help;url=http://support.newsstand.com;target=_blank;status=Help;");
               }
               else
               {
                  aI("image=/images/ns-icon1.jpg;url=http://mckeewwwn;status=NewsStand;");
                  aI("image=/images/pref1.jpg;showmenu=Prefs;status=Preferences;");
                  aI("image=/images/help1.jpg;url=http://support.newsstand.com;target=_blank;status=Help;");
               }
            }
           
            with(milonic=new menuname("Prefs"))
            {
               style=menuStyle2;
               aI("text=Edit Reader Settings;showmenu=settings;status=Reader Settings;separatorcolor=#2D729D");
               aI("text=Account Information;url=/index.cfm?fuseaction=contactinfo;");
               aI("text=Transaction History;url=/index.cfm?fuseaction=AccountSetting;separatorcolor=#2D729D");
               if(showText)
                  aI("image=/images/check.jpg;text=Show Icons and Text;url=javascript:changeTextDisp();separatorcolor=#2D729D");
               else
                  aI("text=Show Icons and Text;url=javascript:changeTextDisp();separatorcolor=#2D729D");
               aI("text=Help;url=http://support.newsstand.com;target=_blank;status=Help;");
               aI("text=Disable Toolbar;url=javascript:disable();");
            }
   
            with(milonic=new menuname("settings"))
            {
               style=menuStyle;
               aI("text=Profile...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_PROFILE', '');");
               aI("text=Download...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_DOWNLOAD', '');");
               aI("text=Viewer...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_VIEWER', '');");
               aI("text=Media...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_MEDIA', '');");
               aI("text=General...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_GENERAL', '');");
               aI("text=Server...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_SERVER', '');");
               aI("text=eDM Server...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_EDMSERVER', '');");
               aI("text=Message Manager...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_ME', '');");
               aI("text=Advanced...;url=javascript:doReaderWebCommand('ID_MAIN_SETTINGS_ADVANCED', '');");
            }

            drawMenus();
         </script>
      </div>
   </body>
</html>
Code:


Poster: mckee __at__ newsstand.com
Dated: Wednesday October 22 2003 - 19:34:47 BST

Hit submit instead of preview

The previous post still exhibits the problem and has elimnated all external issues. The drop menus are way to wide in NS 7.1 with the current release candidate.

Any suggestions?