PDA

View Full Version : Simple Tree Menu - page loading question



ubik
03-05-2007, 04:28 PM
1) Script Title: Simple Tree Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

3) Describe problem: The menu appears to work fine. My only problem is that when the page first loads, it often displays all of the submenus for a second or two, and then (once the code gets to the javascript?) hides the submenus. This can lead to some awkward looking pages while the page is loading, since some of the submenus are rather long. However, the page always ends up looking correct once it is loaded.

Here is the page I am working on.
http://www.amrms.com/clients/laneReport/production/

Is this a problem that others have run into?

thanks.

ddadmin
03-05-2007, 11:22 PM
Do you have the sub lists within the tree menu hidden by default via CSS:


.treeview li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
display: none; /*Hide them by default. Don't delete. */
}

If so the sub lists should be hidden by default, without having to wait for the script to be run. The drawback is that for people without JS enabled, the sublists will be hidden as well, without any way of expanding them.

ubik
03-07-2007, 01:09 PM
Yes, that code is in my stylesheet.

I tried placing style="display: none;" directly in the <ul> tags in the code, and this seemed to fix the problem.

Thanks.