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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:51:00+00:00 2026-05-27T06:51:00+00:00

Really baffled here. I’m just trying to do an addClass(‘test’) on a hovered target…

  • 0

Really baffled here. I’m just trying to do an addClass('test') on a hovered target… my jQuery looks like this:

//#nav-main dropdown effects                
$('#nav-main ul li').hover(function () {
     $('#nav-main ul li').addClass('test');
   $(this).find('.dropdown').stop(true,true).slideToggle('slow');
   $('#nav-main ul li').removeClass("test");
});

The return, however is the HTML going from this:

<li id="menu-events">

to this:

<li id="menu-events" class="">

Any ideas why?

  • 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-27T06:51:01+00:00Added an answer on May 27, 2026 at 6:51 am

    You’re adding and removing the class in the same function. jQuery doesn’t remove the class attribute, even if empty. It seems you’re missing the other callback function for hover–did you want to remove the class on roll out? It seems you want something more like this:

    //#nav-main dropdown effects                
    $('#nav-main ul li').hover(function () { // onRollOver
         $('#nav-main ul li').addClass('test');
         $(this).find('.dropdown').stop(true,true).slideDown('slow');
    }, function() { // onRollOut
         $('#nav-main ul li').removeClass("test");
         $(this).find('.dropdown').stop(true,true).slideUp('slow');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on this file for awhile and I'm just really baffled. I
I'm a bit baffled here. But it might just be my lack of experience.
Just trying to get a handle on blocks. I get the concept. They're like
I'm having an issue with the RadEditor for MOSS, I'm really baffled as to
Really stuck on trying to write code to unzip a file or directory on
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
I'm reading Javascript: The Good Parts and am totally baffled by what's really going
I'm really baffled by this. Have I managed to do something to cause this,
we've got a real confusing problem. We're trying to test an SQL Bulk Load
This is really baffling me. I've never used XML before, so I'm just playing

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.