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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:32:08+00:00 2026-05-26T04:32:08+00:00

So here is what I am trying to accomplish. First I will have about

  • 0

So here is what I am trying to accomplish. First I will have about 8 or so images on the left side of the page and about 8 divs on the right side. Now when a person clicks on an image I want the current div to “hide” and be replaced with the other div that that image is linked to.

For example: I click on 2nd image and the right side changes…then I click the 4th image…the right side is replaced with the div linked to that image and the content that was linked to the 2nd image hides…etc

I have been trying to use the Jquery Toggle function but it seems to be giving me issues and I may not be using it correctly. Was wondering if this is even the way to go…is there a simpler way to go that will get me the same out come?

Here is my current url for testing this before I build the real thing:
http://dtrot55.justinsonline.com/testing/thinkfirst-test/Untitled-1.html

  • 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-26T04:32:09+00:00Added an answer on May 26, 2026 at 4:32 am

    This will work if you set up like this … Also, this is the bare minimum styling … Just what you need to get the functionality to work.

    HTML

    <div id="mainContent">
       <div id="thumbs">
           <a href="#content1">Content1</a>
           <a href="#content2">Content2</a>
           <a href="#content3">Content3</a>
       </div>
    
       <div id="contentWrap">
          <div id="content1">
              <p>Content 1</p>
          </div>
          <div id="content2">
              <p>Content 2. Content 2. Content 2</p>
          </div>
          <div id="content3">
              <p>Content 3 information goes here. Content 3 information goes here. Content 3 information goes here</p>
          </div>
      </div>
    
    </div>
    

    CSS

    #contentWrap { position: relative; }
    
    #contentWrap div { position: absolute; left:0; top:0; }
    

    jQuery

    $(function() {
        $('#contentWrap div').hide();
        $('#contentWrap div:first').show();
        $('#thumbs a:first').addClass('active');
    
        $('#thumbs a').click(function() {
            if ($(this).hasClass('active') == true) {
                return false;
            }
            else {
                $('a.active').removeClass('active');
                $(this).addClass('active');
    
                $('#contentWrap div').fadeOut();
                var contentToLoad = $(this).attr('href');
                $(contentToLoad).fadeIn();
    
                return false;
            }
        });
    });
    

    Edit Explanation:
    Basically, when the page loads. Line 1 says to hide all content Divs. Line 2 says to show the first Content Div inside ContentWrap. Line 3 ads a class to the first Thumb anchor.

    Now on to the click function. Lets pretend for a sec that the if statement is not there and the only code executed for the click function is what’s in the else block. First line removes the class ‘active’ from all Thumb anchors. Second line adds the class ‘active’ to the Thumb anchor you just clicked. Next line fades out all visiable Contents divs within ContentWrap div. The next line create a variable based on the href value of the link you just clicked (which is the ID of the content you want to load). With the ID as a variable, it’s now ready to be used as a selector. The next line uses the variable to select the Content div you want to load and fades it in. Last line prevents the link from executing.

    Why is there an if, else statement. The first part of the if statment simply says, if the Thumb anchor you click on has a class of active, don’t load content. If it doesn’t, then load the content.

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

Sidebar

Related Questions

Here's what I'm trying to accomplish: I've got two tables, call them first and
I will start with what I am trying to accomplish. I have a ListFragment,
What I am trying to accomplish here is to separate a firstname, lastname combo
I'm trying to accomplish what is described here: http://sqldev.wordpress.com/2008/05/06/insert-into-temporary-table-from-stored-procedure/ The article says (with support
I'm wondering if theres a best practice for what I'm trying to accomplish... First
I am trying to record how long a person remains on a page in
In case my initial approach is wrong, here's what I'm trying to accomplish. I
I am using SQL Server 2008r2. Here is what I am trying to accomplish:
This is my first time trying to accomplish core data and been having some
I am trying to write a function the will cut off the first 4

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.