Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Expanding tree java code

    Hiya all... i got a great code from
    http://simplythebest.net/scripts/dhtml_script_100.html

    but... i have edited so it uses my links instead now.

    The result is here
    http://www.duckforceone.dk/koc/test/index.htm

    you can view the source in the index.htm file.

    My problem is this, that i have added so there are now 48 arrays.
    But it doesn't show them all.
    It's not limited in the number of arrays, it seems to be limited to the number of sub links you can create under a parent link.

    There are in the code a Foldout and a non foldout link.
    And there can only be 2 foldout under each foldout. I can have alot more non foldout than 2 but the foldouts i have only been able to have 2 of.

    Could someone help me?

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You were not attentive when reading the Symplythebest specifications. You have to put

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    document.write('<PRE><font face=arial size=3>')
    for (var i = 0; i < outline.length; ++i) {
    if (outline[i].state) {
    for (var j = 0; j < outline[i].depth * 5; ++j) {
    document.write(' ')
    }
    document.write(outline[i].pic, ' ', outline[i].text, '<BR>')
    } else {
    var previous = i
    for (var k = i + 1; k < outline.length && outline[k].depth >= outline[previous].depth; ++k) {
    ++i
    }
    }
    }
    document.write('</font></PRE>')
    // -->
    </SCRIPT>

    in the BODY, not in the head (That means between <body> and </body>
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    was an oversight... but have updated, and it didn't make any differance...

    could anyone explain the note on the authors link about the 5 spaces? i don't quite get which area he's talking about.

    or if there anywhere in the code is a variable that defines the number of main links you can have?

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it should have been places not place.

    what it does is make an indent on 5 space ' ' for each depth.

    Code:
    Item1
         Item2
      \
    Thats the five spaces

  • #5
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, so if i want the indent larger i should just change the 5 to 6 or so?

    any idea for my listing problem though?

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes that should work, the menu don't seem to have problem with multiple foldouts under 1 foldout.
    The menu it self in my opinion is quite bad though since it reloads for ever click making it very blinking, only plus is that it remembers the foldout.

  • #7
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    any suggestions to one i can use then?

    so you can see about 7-8 foldout links under mousendk?
    or just two?

    only took it because it didn't require me to upload any .js scrips to my server.... *S*

  • #8
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can see 6, 5 in the top 1 in the bottom

  • #9
    New Coder
    Join Date
    Jan 2004
    Location
    South of France
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    suggestion

    i use tigra tree menu, but javascript

    free at

    softcomplex.com

    seems to do the same as you intend



  •  

    Posting Permissions

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