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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:58:09+00:00 2026-06-16T00:58:09+00:00

First, please take a look at this pen showing just the menu + the

  • 0

First, please take a look at this pen showing just the menu + the code (preview the menu here).

Coming to the point: In the navbar that you see, clicking on the “Channels” menu shows the menu item sliding out. The problem is, the menu’s background doesn’t represent its active state (i.e. #fff background and #222 color).

Setting the background-color when the mouse is hovered on the menu, is easy. But this one’s tricky. I did try, :active selector to no avail. Any ideas?

SCREENSHOTS:

no mouse hover screenshot

menu with mouse hover screenshot

  • 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-06-16T00:58:10+00:00Added an answer on June 16, 2026 at 12:58 am

    Since it appears as though using jQuery to add/remove a class is the only way to go, I went ahead with it. Here’s the code I used.

    jQuery(document).ready(function($){
      $('.menu-item > a').click(function(){
        $(this).toggleClass('selected');
      });
    });
    

    The code finds the link element a one level down the element with .menu-item class (li in my case), and adds/removes class .selected to the link element.

    Here’s a fork of the original pen with the menu functioning the way I intended it to. You can preview the new and functioning menu here.

    (Full credit to the code provided in this question. More info in the official jQuery documentation.)

    UPDATE: You might find this answer extremely helpful (a better, simpler solution).

    Example code:

    jQuery(document).ready(function($){
        $('.collapse').on('show hide', function () {
            $(this).siblings("a").toggleClass('selected'); 
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well Im stucked at this point.please take a look at this http://jsfiddle.net/karthik64/5jhgF/3/ Okay first
Please take a look at this screenshot first: I would like to move the
Please take a look at this fiddle: http://jsfiddle.net/KA85s/3/ JQ-UI sets first option as default.
Please take a look at this piece of code. I'm allocating one byte for
Am using Struts2 Jquery plugin,Please take a look on this code. <s:iterator status=stat value=primeDisplayLocationBeans>
Please take a look at the following code: http://jsfiddle.net/htdTg/2/ In the first link there
Please take a look at this fiddle jsfiddle.net/Qstuw/2/ As you see from picture first
My question is simple. First off, take a look at this code: http://jsfiddle.net/Jk8Nr/ All
Please take a look at this fiddle http://jsfiddle.net/Qstuw/7/ First answer is selected by default,
Please take a look at this laytout which i built with divs : First

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.