Results 1 to 5 of 5

Thread: Complete newbie!

  1. #1
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    27
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Complete newbie!

    Hi there!

    First of all, i'm a complete dumb on HTML... so, apologize me for any stupid things i say here... I'm posting this here, because i belive that it's JAVASCRIPT, so here it goes:

    I did follow this tutorial:

    http://www.dynamicdrive.com/dynamicindex1/navigate2.htm

    So far so good. I'd manage to make it work just fine. There is only one thing about it. I would like that the last opened menu close when anotherone is opened, because you can actually open 2 items of the menu, and i only want that just one can be opened at the time.

    You can see an example here:

    http://www.sopormetal.pt/crgasteste/regras.html

    Well, i really hope that anyone can help me out here, and by the way, sorry about my english, i'm not an expert in english too...

    Thanks in advance!!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I think all you need to do is close all the other ones when you click on one... like this:

    onClick="expandcontent('thisdiv');contractcontent('otherdiv1');contractcontent('otherdiv2');"

    Just close all the other divs as you open the current one.



    Just out of curiosity, what language do you speak?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    27
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Ok, thnaks for the help, but or i'm not doing it in the correct way, or it's not working... It's funny, because this already suposed to work, see these code parts here:

    var collapseprevious="no"

    ...

    function expandcontent(cid){
    if (typeof ccollect!="undefined"){
    if (collapseprevious=="yes")
    contractcontent(cid)

    What am i doing wrong?

    P.S. - djr33, i'm portuguese, so i speak portuguese

  4. #4
    Join Date
    May 2006
    Posts
    259
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    From what I can tell it's working on my end. If it's still not working on your end try doing what he just told you.
    "Only dead fish flow with the stream".
    - Unknown

  5. #5
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    27
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Well... after some experiments, and some opinions from friends of mine, i made a clean up on the code, and resolve the problem by creating a function that closes colapses the contents no matter what, unless you click on them...

    It worked... But still, thanks a lot!!

    http://www.sopormetal.pt/crgasteste/regras.html

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
  •