Kiirani
01-27-2007, 09:50 AM
Thread posted here because although I have already fixed this problem, it's something that people may need help with in future. It didn't seem to fit anywhere else, but I apologise in advance if anywhere else is where it belongs.
1) Script Title: Simple Tree Menu
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
3) Describe problem:
Script behaves unexpectedly when used without included stylesheet.
Whenever a page is (re)loaded, all items in the menu are visible
Attempting to close submenus that were previously set to closed gives no result until the second click.
The second indicates that the submenus previously set to closed are still considered "closed", despite being visible. The script works fine, a quick look through it reveals that the reason for this is there is nothing in the script to set closed menus to display:none; when the page is (re)loaded.
See the example page (http://kiirani.com/~kiirani/test/treemenu/index.html) I've put up for an example of the problem, a more verbose commentary and a solution.
I would love to know why this script is set up this way, if anyone knows.
1) Script Title: Simple Tree Menu
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
3) Describe problem:
Script behaves unexpectedly when used without included stylesheet.
Whenever a page is (re)loaded, all items in the menu are visible
Attempting to close submenus that were previously set to closed gives no result until the second click.
The second indicates that the submenus previously set to closed are still considered "closed", despite being visible. The script works fine, a quick look through it reveals that the reason for this is there is nothing in the script to set closed menus to display:none; when the page is (re)loaded.
See the example page (http://kiirani.com/~kiirani/test/treemenu/index.html) I've put up for an example of the problem, a more verbose commentary and a solution.
I would love to know why this script is set up this way, if anyone knows.