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

Menu not collapsing/opening when using buildAfterLoad=true


Poster: mashupsoft
Dated: Wednesday June 28 2006 - 1:30:27 BST

I am currently using Milonic 5.749 Pro License Number: 202616, with the parameter buildAfterLoad=true, since I was having some trouble getting around the <div>/<table> placement.

Sure enough, using buildAfterLoad=true corrects the problem of the sub-menus opening on the far right, however, now it turns out that this same parameter makes the submenus avoid auto-opening.

For example, these URL's :
http://www.mashupsoft.com/concepts/need
http://www.mashupsoft.com/concepts/benefit

While they are correctly identified on the sub-menu, the sub-menu does not collapse/open automatically, you can only see where you are at if you click on the submenu manually. This behaviour only occurs when using buildAfterLoad=true .

Unfortunatly, if I use buildAfterLoad=false, while the sub-menu does open automatically where it should, the submenu opens to the far right on account of the <div>

Is there any workaround to using buildAfterLoad=true and the sub-menu's collapsing/opening the way they should ?

(The current site is using buildAfterLoad=true )

Thank you,
Milonic Pro License Number: 202616


Poster: Ruth
Dated: Wednesday June 28 2006 - 2:30:43 BST

Hi,

I take it you are using the openmenusbyurl.js function. That is you are telling the menu to have the submenu of the corresponding page open when it gets there.

The reason it won't open now, is that it does not have a menu with which to match a page as it loads since you have told it to not build anything until the page is loaded. So, the openmenusbyurl.js has no submenu to 'read' and say, ah this matches this page since the menus are not being built unti everthing on the page is loaded.

Hope that made sense.

Ruth

When


Poster: mashupsoft
Dated: Wednesday June 28 2006 - 4:38:47 BST

Hi Ruth,

Thanks got it, makes sense it isn't doing anything since the are no submenus to execute it on.

But I am actually not using the openmenusbyurl.js function (module), but rather the treemenu.js , Treemenu Module version 1.2 , it also has a openBranchByName() function.

Isn't there a way to execute the openBranchByName method after the page is loaded and the menus are built ?
Just as the buildAfterLoad property waits to build the menu after the page has loadad, isn't there a way to piggy back this function call openBranchByName AFTER the menus are built ?

I don't mind having a 'hacked' version of milonic_src.js, but I really do need this functionality, otherwise if I don't use buildAfterLoad=true the menus are horribly offset on account of the <div>

Any ideas on possible workaround or the internals of buildAfterLoad would be greatly appreciated.

Thanks,
Daniel


Poster: Ruth
Dated: Wednesday June 28 2006 - 17:22:59 BST

Hi,

I'll post to Milonic and see if something can be done, in the meantime, you need to upgrade to the newest level. Make sure you keep you're 3 base files that you are using now someplace, in case you have to return to them do to any other issue that may come up.

Ruth


Poster: Ruth
Dated: Saturday July 1 2006 - 15:43:46 BST

Hi,

Andy is working on this and hopes to have something soon.

Ruth

Expected date ?


Poster: mashupsoft
Dated: Monday August 14 2006 - 9:01:41 BST

Hi Ruth,

Just installed the latest 5.753 version, also check downloaded treemenu bolt-on module. but the problem with using buildAfterLoad still present.

Any expected date for a resolution on this ?

Thank you.
Daniel
Milonic Professional License #202616


Poster: Ruth
Dated: Monday August 14 2006 - 13:04:40 BST

Hi Daniel,

I'm sorry I've not heard anything. I'll post to Milonic and see if there's any progress, or if it's even possible when using the buildAfterLoad.

Ruth


Poster: mashupsoft
Dated: Wednesday August 16 2006 - 19:00:52 BST

Hi Ruth,

Just download 5.754 release, noticed it points out: "Modified the way relative menus position their objects. This is a vast improvement on previous versions. The whole menu can now be embedded (include code) inside DIV's and Tables with just one parameter setting (adding buildAfterLoad-true; to your data file will do this)"

However I am still getting the same error, you can see it here

http://www.mashupsoft.com/functions/maps
http://www.mashupsoft.com/functions/search

The error on IE is line 368 char 5 , Object required

Same issue, sub-menu does not open/collapse correctly on account the bolt-on module tries to open an un-existent menu, becuase the menu is being built after the page is loaded (buildAfterLoad=true).

So from what I understand, the bolt-on module code is executed prior to the page being completly loaded, even when using the buildAfterLoad parameter

I guess the technical question boils down to: Can bolt-on module code -- openBranchByName() function in this case -- be configured to execute after the page has been loaded ? It seems strange that the menu core code is executed after the page is loaded as expectecd when using buildAfterLoad, yet the bolt-on module code does not adhere to such parameter.


Thank you again,
Daniel


Poster: Ruth
Dated: Wednesday August 16 2006 - 19:33:15 BST

Hi,

Those links lead only to a page not found. Which version of IE?

Ruth

Active Links.


Poster: mashupsoft
Dated: Wednesday August 16 2006 - 19:47:17 BST

Hi Ruth,

My appologies, pointed to the local/dev site.

Here are the active links
http://www.mashupsoft.com/functions/maps
http://www.mashupsoft.com/functions/search

If you move around the sub-menus (to the left side of the page) you will see the error.
The error on IE is line 368 char 5 , Object required (Using Version 6.0).
One of the reasons I believe the error is on account of the bolt-on module function not being called after the page is loaded, is that line 368 of the bolt-on module treemenu.js corresponds to the body of the function being called : openBranchByName.
And confirming the issue, is that ommiting buildAfterLoad no errors are generated.

Daniel


Poster: WilliamE
Dated: Wednesday August 16 2006 - 19:52:59 BST

I have found a way (at least it works on the site I'm building) to use the menu in div's without using the 'buildAfterLoad=true', and therefore I am able to use openMenusbyURL module, and openBranchByName().

It seems to work if your menu can be absolutely positioned from the top of the page, and relative positioned from the left. I just gave an absolute position for the top, commented out the left and position parms making it absolutely positioned with no left position.

Code:
with(new menuname("mainMenu")){
  top=327
  //left=2
  style = tstyle1;
  alwaysvisible = 1;
  itemwidth=200
  screenposition=left;
  margin=AllMargin
  //position="relative"


This did not work prior to the updates today (the sub menu's would display behind the main menu if buildAfterLoad=true was not set). But now with the re-work, and being able to have the whole script file in the table / div it works beautifully.

William

Absolute positioning won't work for different screens.


Poster: mashupsoft
Dated: Wednesday August 16 2006 - 20:18:14 BST

Tried what you suggested William, but this fails when users with different screen resolution see the menu, a very common/possible scenario on the Net. If you see the position ok on you dev station at 800x600, the menu will be moved to another point on different screen resolutions, since everything is based on absolute positioning.

I need to work this out with relative positioning using buildAfterOnLoad.
Using buildAfterOnLoad the positioning works but the module code execution bombs.
Without buildAfterOnLoad the module code execution works great but the positioning bombs,


I just need the module code execution to be performed after the page is loaded, just like the core menu.

Daniel
Milonic Professional License #202616


Poster: WilliamE
Dated: Wednesday August 16 2006 - 20:27:02 BST

Knew it was to good to be true. Hadn't gotten around to testing on different screen res' yet. Well, put me on the list for some way to get this to work.

William


Poster: Ruth
Dated: Wednesday August 16 2006 - 20:55:35 BST

Hi,

Just out of curiosity, and I have not tested this, but have you tried putting the menu in the table using the old method the one used before buildAfterLoad was available? Of course that might now work now with the buildAfterLoad being part of it, not sure.

Ruth


Poster: WilliamE
Dated: Wednesday August 16 2006 - 21:02:02 BST

Okay, so I went out on a limb,took it one step further and commented out the top position.

Code:
with(new menuname("mainMenu")){
  //top=327
  //left=2
  style = tstyle1;
  alwaysvisible = 1;
  itemwidth=200
  screenposition=left;
  margin=AllMargin
  //position="relative"


Positions fine for me on all resolutions, IE, FF (had to remove fixMozillaZIndex=true); of course had to reload after changing screen resolutions.

Don't have earlier browser versions so not sure how it acts there.

Live URL - With buildAfterLoad true and false.


Poster: mashupsoft
Dated: Wednesday August 16 2006 - 23:49:39 BST

Here are both live examples, one using buildAfterLoad true and another without buildAfterLoad, hopefuly with this, someone at Milonic can help me sort out the build after load issue using bolt-on modules.

Here are four sets of links without buildAfterLoad:

https://www.mashupsoft.com/functions/maps
https://www.mashupsoft.com/functions/search
https://www.mashupsoft.com/functions/feeds
https://www.mashupsoft.com/functions/advertising
https://www.mashupsoft.com/functions/shipping

Navigate around them and notice the sub-menu options, and it automatically collapses/opens on the specifed section, but the positioning is way off. ( Here I have tried absolute positioning, the old way of embedding to no avail, and even the offset parameter for submenus, but since these solutions are based on pixel positions, it does not produce a stable display behaviour for different screen resolutions )

Here are is the same set of links with buildAfterLoad true , (same links except no SSL/https )
http://www.mashupsoft.com/functions/maps
http://www.mashupsoft.com/functions/search
http://www.mashupsoft.com/functions/feeds
http://www.mashupsoft.com/functions/advertising
http://www.mashupsoft.com/functions/shipping

If you navigate around them the menu does not open/collapse in the specified section, if you manually click on the top level menu you see the specified section, but it does not work otherwise, so the bolt-on module function openBranchByName is not working on account of the buildAfterLoad.

Both menu data files are identical, with the exception of buildAfterLoad, the files are located :
Without buildAfterOnLoad : http://www.mashupsoft.com/javascripts/c ... _data_2.js
With buildAfterOnLoad : http://www.mashupsoft.com/javascripts/collapse_data.js

Thanks again for any help on the matter,

Daniel
Milonic Professional License #202616


Poster: Ruth
Dated: Thursday August 17 2006 - 5:53:43 BST

Hi,

I just tried to send you an email and it got returned.

Since you have a professional license you might open a request support ticket. You can find the information in the readme file in the menu download under the docs folder.

Ruth


Poster: WilliamE
Dated: Thursday August 17 2006 - 15:26:15 BST

Link where where it does work without buildAfterLoad=true

http://www.vomela.com/new/mainRetail.html

Use only "Retail signage & graphics, under that "Printing Processes" and under that "Screen Printing". All other menu options will not point to anything. ( I only copied a few over to production to make the point ).

http://www.vomela.com/js/mainMenuData.js

William


Poster: mashupsoft
Dated: Thursday August 17 2006 - 20:16:05 BST

Thanks for the link William, I saw it works without buildAfterLoad, but I would need to rework my whole design (templates) to make the menu work like you have it.

It actually works on your site without buildAfterLoad due to the manner in which you have your <div's> and table's nested. I see you get your page margin(container), having your top most element aligned center, then another document container to 885px and the body is fixed to 800.

I get the margin container, using only one container and using margin: 0 auto; (CSS style centering property) to let the browser align to the center.

In any event, glad it works for you ;) , but I really would not like to mess with my top level <div>/table nesting like that, since it will likely break all the other div positions I have on the page :(

I posted a ticket to Milonic ( thanks for the head's up Ruth ) to see if the issue of calling bolt-on modules functions can be resolved when using buildAfterLoad.


Poster: Ruth
Dated: Thursday August 17 2006 - 20:24:55 BST

Hi Daniel,

I was just getting ready to post that the thing which is causing the submenus to offset like that is your #container section where you have it position:relative; This is in the one without the buildAfterLoad=true;

When I remove that the menu works fine, but I don't know if you can get around the position:relative some way.

The menu is fine, and most of the rest looks OK, but that image at the top right goes out of whack.

Just wanted to let you know.

Ruth


Poster: mashupsoft
Dated: Thursday August 17 2006 - 22:16:29 BST

Tried it like you suggest Ruth, modified the CSS sheet, left out the buildAfterLoad and removed the position:relative; from #container, also adjusted the out of whack image on the right that's offset.

Doing this on any screen resolution different than the dev design whacks the image also...just like it the milonic menu beforehand :(

So still no go, although this is furtheset I've gotten the menu opening, since its CSS sheet specific I will try to tweak it to make the right image stick or wait on a possible resolution when using buildAfterLoad.

It worked.


Poster: mashupsoft
Dated: Friday August 18 2006 - 1:30:27 BST

Thank you for all your help Ruth and William !

With your input I managed to get the menu to automatically collpase without buildAfterLoad, it took some extra work to modify the relative/absolute positions in my stylesheet, but its working as it should now.

Thanks again,
Daniel


Poster: Ruth
Dated: Friday August 18 2006 - 9:14:02 BST

You're welcome. I'd love to see what solution you got, I'm not great at css so anything new I can learn is helpful :)

Ruth