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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:22:08+00:00 2026-05-14T02:22:08+00:00

I have a submenu that has all items linked to the same node, but

  • 0

I have a submenu that has all items linked to the same node, but with different additional parameters, for ex:

...
<li...><a href = "/?q=page1&filter=10" class = "... active">Item1</a></li>
<li...><a href = "/?q=page1&filter=11" class = "... active">Item2</a></li>
...

in this case all items have class ‘active’ and none of them has class ‘active-trail’.

Is there any way to identify the true active link (for styling purposes)?

any suggestions will be much appreciated!

  • 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-14T02:22:09+00:00Added an answer on May 14, 2026 at 2:22 am

    You could also style the active link using Javascript, though admittedly it is rather verbose. Here is the code and you would just change the styles to be how you want.

    window.onload = kickOff;
    
    var aAll;
    
    function kickOff() {
        aAll = document.getElementsByTagName("a");
        // disable and change color of active page's link
        for (var i=0; i<aAll.length; i++) {
            if (window.location.href.split("#")[0] == aAll[i].href) {
                aAll[i].onclick = function() {if (this.blur) {this.blur();} return false;}
                aAll[i].style.cursor = "text";
                aAll[i].style.borderBottom = "none";
                aAll[i].style.color = "#FFFFFF";
                aAll[i].style.textShadow = "none";
                if (aAll[i].className == "site") {
                    aAll[i].style.color = "#ffffff";
                }
                else {
                aAll[i].style.background = "#a5a9b3 scroll 0pt 100%";
                }
            }
            // fix ie's lack of support for css :focus so tabbers see skip links on focus
            if (navigator.appName == "Microsoft Internet Explorer" && aAll[i].className == "skip") {
                var restoreColor = aAll[i].style.color;
                var restoreBorder = aAll[i].style.borderBottom;
                aAll[i].onfocus = function() {this.style.color = "#999999"; this.style.borderBottom = "1px solid #999999";}
                aAll[i].onblur = function() {this.style.color = restoreColor; this.style.borderBottom = restoreBorder;}
            }
         }
        // fixes in-page link bug for Internet Explorer
        if (navigator.appName == "Microsoft Internet Explorer") {
            getElementsByClass("target");
        }
    }
    
    function getElementsByClass(searchClass,node,tag) {
        // fixes in-page link bug for Internet Explorer; first find all destinations (elements with classname "target"):
        var classElements = new Array();
        if ( node == null ) {
                node = document;
        }
        if ( tag == null ) {
                tag = '*';
        }
        var elAll = node.getElementsByTagName(tag);
        var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
        for (var i = 0, j = 0; i < elAll.length; i++) {
            if (pattern.test(elAll[i].className)) {
                classElements[j] = elAll[i];
                j++;
            }
        }
        // then insert what is an invalid attribute for most elements, with an invalid value to boot:
        for (var i=0; i<classElements.length; i++) {
            classElements[i].setAttribute("tabIndex",-1)
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winforms ContextMenuStrip that has ToolTipText set for all of it's ToolStripMenuItem's.
Assume we have a Menu class that has SubMenus (which is the same type
I have a submenu that list departments. Behind this each department have an action
I have the following code that creates a submenu based on current document. The
I'm trying to create something that works like this but doesn't have any submenus.
I have a dropdown (ul.sub-menu) with items inside (ul.sub-menu > li) that I'd like
I have an application that has a top level navigation menu which consists of
I have a pop-up submenu that when you hover your mouse over the parent
I have a navigation menu that has links with CSS3 transitions with a speed
I have a menu in my Android application and this menu has a SubMenu

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.