Re: Menu Generation
2004/11/09 02:16
Viewed 10033 times
Replies: 2/7

In order to hide the UL element you can assign a style="display: none" to it.  Or even better, include it in the page CSS, i.e., if your UL has the id="menu", then you can add the following line to your CSS:

#menu { display: none; }

To speed things up, there are not many things you can do.  The evaluation version is somehow even slower, because it contains mangled code and it takes some time for the browser to interpret it (1-2 sec.).

Re[2]: Menu Generation
2004/11/09 07:26
Viewed 11914 times
Replies: 2/2

Well, is there any way to like "prebuild" the menu, so when it parses on the page it does not neet to go find the lists then build the menu. It could just use a already built menu? Then once the menu is changed a new build would be generated.

last
Re[3]: Menu Generation
2004/11/09 07:29
Viewed 13924 times
Replies: 0/0

OK, I take it all back, I had my cf admin set for debugging ON, that slowed it down quite a bit. Now that is it is off it is moving right along. I will have to say, this is the best darn menu I have ever seen.

Thanks

last
Re[3]: Menu Generation
2005/02/06 03:19
Viewed 12740 times
Replies: 0/0

Well, even if you speeded it up from server-side, there's now a menu option too--but it doesn't make sense unless your menu is really huge (100+ items). The name is “lazy” and if you enable it the menu will feature “lazy initialization” which will improve the startup time by several orders of magnitude for really big menus :-) You can read about it in the documentation.

last
Re[2]: Menu Generation
2004/11/26 07:52
Viewed 11368 times
Replies: 1/3

Mishoo, this isn't a good idea. Browsers with javscript DISABLED will never see the menu.

last
Re[3]: Menu Generation
2004/11/26 08:25
Viewed 13349 times
Replies: 1/2

OK, after telling you your method is not a good idea, then I should probably try to give you a solution ;)

What we need is some way of hiding the menu via JS. The problem is that your script will only run ONLOAD which is too late (the unstyled menu will already be displayed). There are 2 ways to take care of this:

1. You could insert an inline script (inside the body, just before the menu) which does something like:
document.getElementById("menu").style.display = "none";
then when onload is triggered
document.getElementById("menu").style.display = "block";

2. If you want to keep scripts in the HEAD only to avoid changing all your pages html, then you can only access 1 element (the HTML tag). So I would add a class to it some way:
document.documentElement.className = "JSenabled"
or something like this (not sure if this works????)
document.getElementsByTagName("html")[0].className = "JSenabled"

Then add this to your css:
html.JSenabled #menu { display: none }

You would try to do this as SOON AS POSSIBLE on the page so while the page and scripts are loading the menu gets hidden.

Then onload you would remove the classname from the HTML element:
document.documentElement.className = ""
and the menu would show up :)

I would go with method 2.

last
Google