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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:59:29+00:00 2026-05-13T10:59:29+00:00

I am going to have an ExpressionEngine weblog that will place user designed content

  • 0

I am going to have an ExpressionEngine weblog that will place user designed content blocks in the footer. But, it’s only going to show one at at time.

My HTML looks like this:

<ul class="footernav">
    <li class="first"><a class="active" href="#">Get in touch</a></li>
    <li><a href="#">Interested in joining?</a></li>
    <li><a href="#">Feedback</a></li>
    <li><a href="#">Link 4</a></li>
</ul>
<div class="copy gutters show">
    <p>Lorem Ipsum</p>
</div>
<div class="copy gutters hide">
    <p>Lorem Ipsum</p>
</div>
<div class="copy gutters hide">
    <p>Lorem Ipsum</p>
</div>

I want to switch the show class to a hide class depending on the clicked link. Not sure how I can accomplish this. It has to be flexible enough to work with N number of content blocks–because they will be defined by the user in ExpressionEngine.

I’m pretty much brand new to JavaScript so I would really appreciate any insight, or solution for how I might accomplish this.

  • 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-13T10:59:29+00:00Added an answer on May 13, 2026 at 10:59 am

    I think this would work with your structure:

    // Cycle through each link in our ul.footernav element
    $(".footernav a").each(function(i,o){
      // Attach click-logic to each link
      $(this).click(function(e){
        // Prevent page from bouncing, reloading, etc.
        e.preventDefault();
        // Add .active class to this, but remove from all other links
        $(this).addClass("active").closest("li").siblings("li").find("a").removeClass("active");
        // Show any DIV having class .copy and same index as clicked link
        // meaning, clicking the second link will show the second div
        $("div.copy:eq("+i+")").show().siblings("div.copy").hide();
      });
    });
    

    Demo Online: http://jsbin.com/ekecu

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

Sidebar

Ask A Question

Stats

  • Questions 290k
  • Answers 291k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to allocate memory for persons: comp->persons = malloc(… May 13, 2026 at 5:54 pm
  • Editorial Team
    Editorial Team added an answer As mentioned in a comment, I never found a solution… May 13, 2026 at 5:53 pm
  • Editorial Team
    Editorial Team added an answer If they are guaranteed to appear sequentially in your document,… May 13, 2026 at 5:53 pm

Related Questions

I am going to embed a Flex app on an html page. The html
For simplicity I am going to use Northwind as an example... I would like
I have been called in to clean up and get started again in a
I am working on a top-down view 2d game at the moment and I
I have an RTF file that I need to display to a user. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.