Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7038223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:38:35+00:00 2026-05-28T01:38:35+00:00

Having a html structure like this: <div id=newest> <nav> <ul id=newNav> <li><a href=#>Dani’s Photos</a></li>

  • 0

Having a html structure like this:

<div id="newest">
    <nav>
        <ul id="newNav">
            <li><a href="#">Dani's Photos</a></li>
            <li><a href="#">Alex's Photos</a></li>
        </ul>
    </nav>
    <ul class="dani">
        <li>........</li>
        <li>........</li>
        <li>........</li>
        <li>........</li>
        <li>........</li>
        ...
    </ul>
    <ul class="alex">
        <li>........</li>
        <li>........</li>
        <li>........</li>
        <li>........</li>
        <li>........</li>
        ...
    </ul>
</div>

Dani’s Photos corresponds to ul class=”dani” and Alex’s photos to ul class=”alex”. What I need is to show only 1 ul at the time, and show/hide the other when click on the links inside , and showing by default the first ul.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:38:36+00:00Added an answer on May 28, 2026 at 1:38 am

    I would do it like this

    <div id="newest">
        <nav>
            <ul id="newNav">
                <li><a href="#" data-target="dani">Dani's Photos</a></li>
                <li><a href="#" data-target="alex">Alex's Photos</a></li>
            </ul>
        </nav>
        <ul class="dani">
            <li>........</li>
            <li>........</li>
            <li>........</li>
            <li>........</li>
            <li>........</li>
            ...
        </ul>
        <ul class="alex">
            <li>........</li>
            <li>........</li>
            <li>........</li>
            <li>........</li>
            <li>........</li>
            ...
        </ul>
    </div>
    

    and

    $(function(){
        $('#newNav a').click(function(){
          var selected = $(this).data('target');
          $('#newest > ul').hide().filter('.' + selected).show();
        }).first().click();
    });
    

    demo at http://jsfiddle.net/gaby/zkPcb/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML structure like this:- <article id=a_post class=a_post> <div id=thumbnail> <img id=shine
i'm having this html structure: <div class=container> <div class=content> Content goes here </div> </div>
i am having a html structure like <ul> <li> <span class=vcard> <a class=underline user-link
I have a HTML structure like follows <div id=answer-1> <a class=edit></a> </div> <div id=answer-2>
i am having a HTML like <p style= class=fieldChoices title>Choices: <input value=option1 maxlength=150 id=Choice1/>
I have the following HTML structure, (This cannot change). <!-- Comment 1 --> <div
How can I use Nokogiri with having html entities (like German umlauts) untouched? I.e.:
I'm following this tutorial http://www.vogella.com/articles/AndroidIntent/article.html for having some data transfered to parent activity by
I have the following html: <div class=canvas red> <div> <div class=canvas blue> <div> has
tl;dr summary : jQuery's load() method called like: $('#foo').load('similar.html #foo') results in DOM structure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.