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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:39:25+00:00 2026-05-30T13:39:25+00:00

I am very new to using HTML and CSS and am having a bit

  • 0

I am very new to using HTML and CSS and am having a bit of trouble getting buttons to show that they are active (i.e. by default, button1 has alternate colour to show its already selected). When they click on button2, the content above changes (successfully) and then button2 should become the active one.

However, at present, I can’t even get button1 to be default active. I have done this successfully elsewhere on the page.

Here is the HTML: its worth noting I have named my other successful attempt at this class=”active” also

<div id="left-top-container">
        <ul id="selectionInfo">                    
            <li id="disc">Noiseproofing Joist Tape</li>
            <li id="compound">Compound</li>
            <li id="clip">Clip</li>
            <li id="sealant">Sealant</li>                    
        </ul>
    </div>
    <div id="left-bottom-container">                
        <ul id="buttons">
            <li id="discSelection" class="active"><a href="#disc">Disc</a></li>
            <li id="compoundSelection"><a href="#compound">Compound</a></li>
            <li id="clipSelection"><a href="#clip">Clip</a></li>
            <li id="sealantSelection"><a href="#sealant">Sealant</a></li>
        </ul>
    </div>

Here is the CSS:

#buttons
{ position:relative; left:-44px; top:-44px; }
#buttons li
{ float:left; list-style:none; }
#buttons li a
{ float:left; list-style:none; position:relative; text-indent:-9999px; }
#discSelection a
{ background: url(/Content/images/unhighlighted.png) no-repeat 0 0; height:88px; width:162px; padding:0; }
#discSelection a:hover, #discSelection a.active
{ background: url(/Content/images/tops.png) no-repeat 0 0; width:162px; height:106px; top:-13px; }
#compoundSelection a
{ background: url(/Content/images/unhighlighted.png) no-repeat -162px 0; height:88px; width:159px; padding:0; }
#compoundSelection a:hover, #compoundSelection a.active 
{ background: url(/Content/images/tops.png) no-repeat -162px 0; width:159px; height:106px; top:-13px; } 
#clipSelection a
{ background: url(/Content/images/unhighlighted.png) no-repeat -321px 0; height:88px; width:159px;  }
#clipSelection a:hover, #clipSelection a.active
{ background: url(/Content/images/tops.png) no-repeat -324px 0; width:159px; height:106px; top:-13px; }
#sealantSelection a
{ background: url(/Content/images/unhighlighted.png) no-repeat -480px 0; height:88px; width:159px; }
#sealantSelection a:hover, #sealantSelection a.active
{ background: url(/Content/images/tops.png) no-repeat -486px 0; width:159px; height:106px; top:-13px; }   

And here is the JQuery script:

$(document).ready(function () {
$("#main-body-options a").click(function (e) {
    showSlide($(this).parent().index())
    return false;
});
$("#buttons a").click(function (e) {
    showSlide2($(this).parent().index())
    return false;
});
});

function showSlide2(index) {
$("#buttons.active li.active").removeClass("active")
$("#buttons li").eq(index).addClass("active")
$("ul#selectionInfo").animate({ top: -409 * index}, { duration:600, easing:"easeInOutQuint" })
}

If I am not clear anywhere please ask or edit to make it more readable.

  • 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-30T13:39:26+00:00Added an answer on May 30, 2026 at 1:39 pm

    Check all your css and html and put the active class ONLY on the a element

    Then modify your jquery to this:

    $("#buttons a").click(function (e) {
       $("#buttons a").removeClass("active");
       $(this).addClass("active");
       showSlide2($(this).parent().index())
    return false;
    });
    
     function showSlide2(index) {
        $("ul#selectionInfo").animate({ top: -409 * index}, { duration:600, easing:"easeInOutQuint" })
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to using infragistics controls (started yesterday). While they are (very)
I still very new using Subversion. Is it possible to have a working copy
I am very new to NTLM/LDAP and trying to authenticate using NTML running on
I'm very new to C#. My boss asked me to wrote some code using
Guys i am very new to jQuery. I have started using the auto complete
I'm very new to MVC, and just building my first site, using NerdDinner as
I'm using MVVM in a WPF app. I'm very new to both. Let me
I have built a very simple blog application using Ruby on Rails. New to
I need an editor that outputs clean HTML, and preferably strict XHTML with CSS,
I am very new to CSS. please go easy on me. I am interested

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.