Results 1 to 3 of 3

Thread: Simple Tree Menu - Closed submenus visible on (re)load

  1. #1
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple Tree Menu - Closed submenus visible on (re)load

    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 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.
    Last edited by Kiirani; 01-27-2007 at 09:58 AM. Reason: Did not use a descriptive title.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi:
    Thanks for taking the time to detail your issue. You're right, the script does rely on CSS to initially hide the desired folders instead of via scripting, which in hindsight isn't the best approach (ie: user turns of JavaScript). Just so you know, most scripts on DD are updated every few months to include feedback from users as far as bugs or requested features are concerned. So the next time this script is updated, I'll definitely be addressing the aforementioned issue. The more recent scripts dealing with hidden content on DD all take the approach of downgrade compatibility with browsers that may have JavaScript turned off, for example, the updated Switch Content script. It's an ever evolving process for scripts here on DD.

  3. #3
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, well thank you It's good to know that any problems won't be left to rot in your scripts.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •