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

  • Home
  • SEARCH
  • 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 580561
In Process

The Archive Base Latest Questions

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

I have a problem with the links, I have created a menu made by

  • 0

I have a problem with the links, I have created a menu made by links, which at the same time, indicates the user in what section he is.
The menu works fine, but when I start doing things on the section under that link ( which it is pseudo-class active, as its been selected) then the link selected change to a normal link, therefore the user will lose orientation.

I don’t think the code its necessary, but just in case anyone need it.

.menu
{
    width:100%;
    text-align:center; 



    }
.menu a
{
    height:30px;
    width:170px;
    background-image:url('../Images/item.png');
    background-repeat:no-repeat;
    background-position:center; 
    color:Black;
    font-weight: bold;
    font-family: Arial;
    font-size: 11px;
    text-decoration: none;
    cursor:pointer;
    word-spacing:-1px;
    border:none;
    padding:1px 0px 0px 0px;
    margin-top:1px;
    }

.menu a:hover
{
    background-image:url('../Images/itemHover.png');
    background-repeat:no-repeat;
    background-position:center;
    font-weight: bold;
    font-family: Arial;
    font-size: 11px;
    text-decoration: none;
    cursor:pointer;
    word-spacing:-1px;

    }
 .menu a:active
{
    background-image:url('../Images/itemActive.png');
    background-repeat:no-repeat;
    background-position:center;   
    color:White;
    font-weight: bold;
    font-family: Arial;
    font-size: 11px;
    text-decoration: none;
    cursor:pointer;
    word-spacing:-1px;
    text-decoration: none;
    }




            <div class="menu" >
              <a  href='vbscript:show(0)' id='focusme'>Section1</a>
              <a  href='vbscript:show(6)'> Section2 </a>
              <a  href='vbscript:show(2)'> Section3 </a>
              <a  href='vbscript:show(3)'> Section4 </a>
              <a  href='vbscript:show(4)'> Section5</a>
              <a  href='vbscript:show(5)'> Section6 </a>
              <a  href='vbscript:show(1)'> Section7</a>
              <a  href='vbscript:show(7)'> Section8 </a>
              <a  href='vbscript:show(8)'> Section9 </a>
              <a href="javascript:calllast24()"> Section10</a>
            </div>

Can anybody give me a hint on 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-13T14:29:10+00:00Added an answer on May 13, 2026 at 2:29 pm

    Just define another class active together with a:active and add that class to the link in question dynamically (and remove the same class from any other links in the menu).

    JavaScript / jQuery is perfectly applicable for this. E.g.

    $('.menu a').click(function() {
        $('.menu a').removeClass('active');
        $(this).addClass('active');
    }
    

    Update: or if those links are actually synchronous and you’re actually using a server-side view technology like PHP/JSP/ASP, then you’ll need to grab its powers instead. Here’s a JSP example:

    <ul id="menu">
        <li><a href="foo" ${page == 'foo' ? 'class="active"' : ''}">foo</a></li>
        <li><a href="bar" ${page == 'bar' ? 'class="active"' : ''}">bar</a></li>
        <li><a href="boo" ${page == 'boo' ? 'class="active"' : ''}">boo</a></li>
    </ul>
    

    The above example only adds class="active" when the current page matches the link’s href. You can do similar in PHP (that ternary operator). Not sure about ASP though.

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

Sidebar

Ask A Question

Stats

  • Questions 315k
  • Answers 315k
  • 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 eventually done this by creating a CustomAttribute Seems like overkill… May 13, 2026 at 11:10 pm
  • Editorial Team
    Editorial Team added an answer Simple example using jQuery: JavaScript/jQuery <script type="text/javascript"> $(document).ready(function(){ $('.faqlink').click(function(){ $('.content').hide();… May 13, 2026 at 11:10 pm
  • Editorial Team
    Editorial Team added an answer I put my configuration object the in the JNDI tree.… May 13, 2026 at 11:10 pm

Related Questions

I have created a feature in Visual Studio, using WSPBuilder to build the .wsp
I have created a jQuery content switcher . Generally, it works fine, but there
I have a Google calendar embedded on a webpage, with events related to activities
I have two sets of data which I need to join, but there is
The concept So, I've already made (upgraded actually) this website with its own Content

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.