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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:31:20+00:00 2026-06-09T14:31:20+00:00

I think this should be a simple fix, or perhaps I am going at

  • 0

I think this should be a simple fix, or perhaps I am going at this the wrong way.

I have an accordion menu that slides up and down on click of a button. The button that activates the the accordion has a static, hovered, and clicked state, simply changing the text color.

All works fine, unless you close an accordion menu after having scrolled down the page. The browser window moves up collapsing the accordion, but it never activates the hover off function, so the button remains in the clicked state. If you hover over the button, everything goes back to the way it should be.

Is there a way to have the click state override the hover off state, so it goes back to the static color?

Have some code. It may help explain what I am saying.

I made a fiddle here

You will not really be able to see the actual of the problem because it is all in the self-contained fiddle box.

Let me know if I can try to explain this further.

  • 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-09T14:31:21+00:00Added an answer on June 9, 2026 at 2:31 pm

    As Sam Dufel said, using :hover would yield better results. You can also use classes instead of setting the css property directly, that way the browser would do for you the hard job of deciding which style to show at some given moment.

    .dropdown.expanded {
        color:#000;
    }
    
    .dropdown.collapsed {
        color:#BDBDBD;
    }
    
    .dropdown:hover {
        color:#6e6e6e;
    }
    
    ...
    
    // Remove the whole $.hover
    
    if (submenu.is(":hidden")) {
        submenu.stop().slideDown('fast');
        $(this).removeClass("collapsed").addClass("expanded");
    }
    else {
        submenu.stop().slideUp('fast');
        $(this).removeClass("expanded").addClass("collapsed");
    } 
    

    Demo at jsFiddle.

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

Sidebar

Related Questions

This should be a simple fix; I currently have a calendar for selecting a
I think this should be simple but I am having some difficulty implementing it.
I think this should be simple, but im having a real hard time finding
sed 's/^\(\h*\)\(.*\)$/\1<!-- \2 -->/' web.xml I think that this should take this xml: <a>
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
Dear all,Now i have this question in my java program,I think it should be
this should be simple to fix--but it's not because of IE7, or at least,
This should be simple but I can't find a solution: I have a custom
How can I force validation when user clicks button? One would think this should
I am getting to know boost::variant. I think this example should work. #include <boost/fusion/sequence.hpp>

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.