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 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Menu help/advice

    Hi

    I'm hoping someone can help!

    I have a drop down menu, but I want tab2 to change depending on what link was selected in tab1...

    Code:
    <ul id="menu" class="menu">
      <li class="tab1"><a href="#">tab 1</a>
        <ul>
          <li class="active">item 1</li>
          <li>item 2</li>
          <li>item 3</li>
        </ul>
      </li>
    
      <li class="tab2 item1" style="display:block"><a href="#">tab 2</a>
        <ul>
          <li class="active">item 1</li>
          <li>item 2</li>
          <li>item 3</li>
        </ul>
      </li>
    
      <li class="tab2 item 2" style="display:none"><a href="#">tab 2</a>
        <ul>
          <li class="active">item 1</li>
          <li>item 2</li>
          <li>item 3</li>
        </ul>
      </li>
    
      <li class="tab2 item3" style="display:none"><a href="#">tab 2</a>
        <ul>
          <li class="active">item 1</li>
          <li>item 2</li>
          <li>item 3</li>
        </ul>
      </li>
    </ul>
    So if item 1 is active in tab1 I want to display tab2 item1 if item2 is active from tab1 then tab2 item2 will display.

    Whats the best way to do this?

    Hope someone can help.

    Thanks
    Last edited by dips045; 04-20-2013 at 09:29 PM.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,112
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Difficult to say what's wrong when you do not give the entire code ...
    The menu utilizes CSS to cause the changes, but you have not shown this!

  • #3
    New Coder
    Join Date
    Mar 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I'm not sure how to go about it or if it's even possible so needed some help and guidance with it.

    Is this something you can help me with?
    Many thanks.

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,112
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Exclamation

    Quote Originally Posted by dips045 View Post
    I'm not sure how to go about it or if it's even possible so needed some help and guidance with it.

    Is this something you can help me with?
    Many thanks.
    Where did you find the code in post #1?
    If you did not write it, at least show where it came from. There are missing pieces in the post.

  • #5
    New Coder
    Join Date
    Mar 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts
    any ideas?
    Last edited by dips045; 04-21-2013 at 08:58 PM.

  • #6
    New Coder
    Join Date
    Mar 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    Where did you find the code in post #1?
    If you did not write it, at least show where it came from. There are missing pieces in the post.
    I didn't find it, this is my own code.
    It's not my full menu as the question is just about the first two tabs.

    theres no code missing... that was a sample code as an example to show what I am trying to achieve...
    My dropdown menu works fine. I'm just not sure how to go about populating tab 2 depending on what was selected in tab1...
    So I'm asking in the forum for some advice and help....
    Last edited by dips045; 04-21-2013 at 09:01 PM.

  • #7
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,112
    Thanks
    38
    Thanked 498 Times in 492 Posts
    The code you provided will not validate AS IS so it is not complete.

    You use "class=" assignments, but you do not define them.

    Finally, you post on the javascript forum, but you have no JS in your example.

    Good Luck!
    and good bye.


  •  

    Posting Permissions

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