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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:55:42+00:00 2026-05-20T22:55:42+00:00

ok so heres my nav setup <div id=headerMenu> <ul> <li style=width:147px><a href=/?page_id=92 class=menuHov><span>ABOUT<br/>ABOUT</span></a></li> <li

  • 0

ok so heres my nav setup

<div id="headerMenu">
            <ul>  
                <li style="width:147px"><a href="/?page_id=92" class="menuHov"><span>ABOUT<br/>ABOUT</span></a></li>
                <li style="width:186px"><a href="/?page_id=64" class="menuHov"><span>STOCKISTS<br/>STOCKISTS</span></a></li>
                <li style="width:146px"><a href="/?page_id=96" class="menuHov"><span>PRESS<br/>PRESS</span></a></li>
                <li style="width:128px"><a href="/?category_name=blogs" class="menuHov"><span>BLOG<br/>BLOG</span></a></li>
                <li style="width:70px"><a href="/?page_id=89 " class="menuHov"><span>CONTACT<br/>CONTACT</span></a></li>
            </ul>

i need a jquery script to recognize the page_id variable and the href and if they’re the same, change color… let me know if you need anymore info…

heres what i tried so far.

 $(document).ready(function() {
    $('a.menuHov[href$=' + window.location.pathname + ']').css('color', '#fae349');
});

but that changes everything because i guess it doesn’t recognize the href as a pathname

  • 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-20T22:55:42+00:00Added an answer on May 20, 2026 at 10:55 pm
    $(function(){
        var page_id = getParameterByName("page_id");
        $("a.menuHov[href$=" + page_id + "]").css('color', '#fae349');
    })
    

    Include the query string parser from here

    function getParameterByName( name )
    {
      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
      var regexS = "[\\?&]"+name+"=([^&#]*)";
      var regex = new RegExp( regexS );
      var results = regex.exec( window.location.href );
      if( results == null )
        return "";
      else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code : <div class=Cat-list unselectable style=font-weight:bold;> <div class=right-bar-nav-item> <asp:HyperLink runat=server ID=lnkHome
I have a setup lets say like follows: <div id=nav> <div id=innernav> //With dynamic
I have a header set up like this: <div id=header> <div class=container_16> <div class=grid_4><img
Here's my function to load my content: $(#site-nav .nav1).on('click', function () { $(this).addClass(nav-active); $('ul.top-level').load('assets/includes/recent.php',
Here are the tabs in the master page: <nav> <ul id=menu> <li><%: Html.ActionLink(Home, Index,
Not sure what's going on here, but my iPhone apps nav bar shows back
Heres a screenshot to make it clear. I'm trying to figure out a robust
Heres the link: DAMNIE6TOHELL As you can see if viewed in glorious 'IE6-o-color', the
Heres my link: http://tinyurl.com/6j727e If you click on the link in test.php, it opens
Heres the problem. I use around three different machines for development. My partner is

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.