Error: It does't look like your background color changed, is your hover adding the class active?


#1

Hi all,
I have the same issue and this is my code:

$(document).ready(function(){

  $('div').hover(
    function(){
        $(this).addClass('active');
    },
    function(){
        $(this).removeClass('active');    
    }
  );

});

Error: Oops, try again. It does't look like your background color changed, is your hover adding the class active?

If you are using IE, try removing this line [transition: background-color 0.5s ease;] from stylesheet.css. This line causes issues in IE.

But still not working.


.hover?
#2

Hi @carlosmcoelho,

Your code looks fine to me. Could you try refreshing the page, and see if that works?

If it doesn't, please post a link to the exercise you're on :slight_smile:


#3

Hi @zystvan,

Still, here is the link:

https://www.codecademy.com/en/courses/web-beginner-en-JwhI1/1/2?curriculum_id=50a3fad8c7a770b5fd0007a1

Thank you,


#4

Hello @carlosmcoelho,

Your code is identical to my code. What browser are you using? Codecademy is known to be very glitchy on some browsers...


#5

Hi @bartholomewallen,

I already tried with FireFox Version 47.0 in Ubuntu and Chrome in Windows.

Thank you,


#6

Did you try it while removing the transition: background-color 0.5s ease; or No?

Thank you


#7

@carlosmcoelho Thanks for the link, I tested it myself and this exercise doesn't work well in Firefox; I don't know why, but I've never been able to pass it using Firefox. Switching to Chrome lets me pass, though. Could you try:

  1. Click “Save & Submit Code”
  2. Hover onto any <div> for two seconds
  3. Move your mouse off the <div>
  4. Wait two seconds, and return to the editor

and let me know if that works?


@bartholomewallen

Codecademy is known to be very glitchy on some browsers

Not really, any somewhat modern browser will work pretty well with Codecademy. Browser glitches in the old courses are usually minor, and are becoming less common thanks to their new learning environment :slight_smile:


#8

Hi @oalayoubi, yes I did but didn't work.

Hi @zystvan,
I did your steps and is working, finaly done. :wink:

  1. Click “Save & Submit Code”
  2. Hover onto any
    for two seconds
  3. Move your mouse off the
  4. Wait two seconds, and return to the editor

Thanks a lot for the support of you all.


#9

Hey hover your mouse on

"Home" then "About us" then "Contact us" and it will work.

It worked for me!!!


#10