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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:07:33+00:00 2026-05-28T00:07:33+00:00

As with a few other posts here on StackOverflow, I’m looking to load in

  • 0

As with a few other posts here on StackOverflow, I’m looking to load in content from a series of hidden divs into a primary content div. However, I am looking to extend this functionality and do something I wasn’t able to find in any other posts.

I did find an answer to the basis of this question here as provided by Shyju.

While the solution works very well, I would like to extend this and be able to link to a hidden div from within the active div (or #ajax as listed in the solution linked).

Ideally, I would like to have a navigation section that contains home, previous and next links that all pull from hidden divs to replace the content of an #activeContent div. The initial content of #activeContent (Home) would be something of a table of contents which would allow you to press on a list item to jump directly to the associated hidden div, replacing the table of contents.

I’ve used modified gallery sliders in the past to accommodate this, but I didn’t want to have to scroll past all the divs between point A and point B on the way to point B. I find the ajax method of simply replacing the content to be much more elegant in this context.

Hopefully my request for assistance makes sense. Any help would be greatly appreciated!

My current code looks like this –

$(".itemLink").click(function () {

    var id = $(this).attr("id").replace(/^.(\s+)?/, "");
    var contentTobeLoaded = $("#item_" + id).html();

    $('#activeContent').fadeOut(600,function(){
        $('#activeContent').html(contentTobeLoaded).fadeIn(500, function () {
        //do whatever you want after fadeIn
        });
    });

});

<body>

<section id="navigation">
    <a href="#" class="itemLink" id="a1">Item 1</a>
    <a href="#" class="itemLink" id="a2">Item 2</a>
    <a href="#" class="itemLink" id="a3">Item 3</a>
</section>

<section id="content">
    <h3>Content will be displayed below</h3>

    <div id="activeContent"></div>
</section>

<section id="hiddenContainer" style="display:none;">
    <div id="item_1">
        Item 1 content<br><br>
        <a href="#" class="itemLink" id="a4">Item 4</a>
    </div>

    <div id="item_2">
        Item 2 content
    </div>

    <div id="item_3">
        Item 3 content
    </div>

    <div id="item_4">
        Item 4 content
    </div>
</section>

  • 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-28T00:07:33+00:00Added an answer on May 28, 2026 at 12:07 am

    You need to change your click method to use the live method. When you move the content from the hidden div to your active, it’s erasing the event tied to your a elements. live maintains all events on current and future elements.

    $(".itemLink").live('click', function () {

    Fiddle Demo: http://jsfiddle.net/hSyYE/

    Note

    If your using jQuery 1.7+ then the proper way would be

    $('body').on('click', 'a.itemLink', function () {

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

Sidebar

Related Questions

This question seems similar to those asked in a few other posts: here and
I've read through a few other threads on here, though none of them really
I've read a few other posts like this one about avoiding repetition in Java
I have read a few other posts on Stack Overflow and did some Googling
I've read a few posts on Stack Overflow and a number of other site
I've been reading a few posts in here and some are related to my
i know there's a few other posts like this, but i've been on this
After reading a few posts here I formulated this function which is sort of
There are quite a few other questions on here that tell you how to
I'm generating titles out of a few other fields, and want the right way

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.