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 3277178
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:20:28+00:00 2026-05-17T19:20:28+00:00

I have a page that’s content is already inside a tab, and don’t want

  • 0

I have a page that’s content is already inside a tab, and don’t want to use a tab inside a tab. There will be 4 years 2010, 2009, 2008, 2007 that are anchors across the top of the #content div. When you click a year, it should load the specific content via jQuery’s ajax load functionality into the div#content. That is easy enough. Is it possible to make a click function that will hide whatever is currently visible and display the appropriate content?

 $("a#foo").click(function(){
    $("#Year10").load("2010.php #content");
    $("#Year09, #Year08, #Year07").hide();
  });

I guess what I’m asking is it possible to make it hide anything that currently is in the #content div and show the appropriate div? Would this be better with the content being external pages or div’s that are hidden on load?

thx

  • 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-17T19:20:28+00:00Added an answer on May 17, 2026 at 7:20 pm

    Nope, you’re on the right track.

    Assuming you had links like these

    <ul id="menu">
        <li><a href="2010.php">2010</a></li>
        <li><a href="2009.php">2009</a></li>
        <li><a href="2008.php">2008</a></li>
    </ul>
    

    And a content div

    <div id="content"></div>
    

    You just need to write a simple jQuery function.

    $("#ul#menu li a").click(function(e) {
        // Prevent going to the page
        e.preventDefault();
    
        // store the parent (li)
        var $parent = $(this).parent();
    
        // add class of selected on parent li, and remove it from any other elements
        $parent.addClass("selected").siblings().removeClass("selected");
    
        // get href
        var href = $(this).attr('href');
    
        $("#content").load(href + " #content", function() {
            // do something after content is loaded.
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that lets the user edit the content of the page
I have a page that I want to update non stop, every few seconds.
I have a page that consists of a header div for navigation, a content
I have a page that I load a select dropdown box but I want
I have a page that displays various fields from a mysql_query. I only want
I have a page that has a header, content, and footer. The header and
I have page that is receiving a query string and I want it so
I have a page that dynamically generates any number of divs.  Inside the div
I have a page that contains a WebBrowser control that is frequently updating content.
I have a page that I would like to use some sencha items on

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.