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 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    pa
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with "Menu (FileTree) Script"

    I am currently working on this site: http://www2.hfs.psu.edu/TravelTest/

    If you click on the button Program Information button you will see I am calling Menu1. With the script I am currently using I am can the image "closed.gif" into "open.gif" ... does anyone know how to add on to the script so I can call up several different images?

    Namely, if I wanted to also change the "Program Information" button to a secondary image when they click it and change it back when they click it again, how could I go about doing that?

    Thanks in advance
    Ryan
    Tall and Proud he stands
    Desert sun his only friend
    The Jumbo Cactuar

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Nice little menu.

    Doesn't it already do that?

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    pa
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, currently it only changes the images marked by (open.src="open.gif") and (closed.src ="closed.gif")

    The code looks something like this:

    </script>

    <script language="javascript">
    <!--
    var Open = ""
    var Closed = ""

    function preload(){
    if(document.images){
    Open = new Image(16,13)
    Closed = new Image(16,13)
    Open.src = "open.gif"
    Closed.src = "closed.gif"
    }}


    function showhide(what,what2){
    if (what.style.display=='none'){
    what.style.display='';
    what2.src=Open.src
    }
    else{
    what.style.display='none'
    what2.src=Closed.src
    }
    }
    -->
    </script>

    Then the area that activates the dropdown is marked like this:
    <span id="menu1" onClick="showhide(menu1outline,menu1sign)" style="cursor:hand">

    The image that I change is marked with this:
    <img id="menu1sign" src="closed.gif" width="31" height="17">

    and finally, the area that dropsdown is marked with this:
    <span id="menu1outline" style="display:'none'">

    That is all of the actually working code other then adding a preload to the body tag. In this you can see it only changes ONE image, but displays anything I like under said image. My goal is to use the code to change several images at once.

    Maybe adding more something.src = "something" .... I'm not sure. That is what I am asking. I have tried a couple different things, but nothing seems to work. Any help would be greatly appreciated.

    -Ryan
    Tall and Proud he stands
    Desert sun his only friend
    The Jumbo Cactuar

  • #4
    New Coder
    Join Date
    Oct 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a way that you can expand all the submenu's at once?

  • #5
    New Coder
    Join Date
    Jul 2002
    Location
    pa
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm ... I've never tried that, but I'm sure if you make a button that is marked with the same code, but tells it to open all menus it would do it.

    Like: <span id="menu1" onClick="showhide(menu1outline,menu2outline,menu3outline,menu4outline,menu5outline)" style="cursor:hand">

    That is saying you have 5 menus and once you like on the button that span id is attached to, then it would open all 5.
    Tall and Proud he stands
    Desert sun his only friend
    The Jumbo Cactuar


  •  

    Posting Permissions

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