Another hiccup with 6. Hover


#1


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


I passed it the first time using 'div' instead of this, but when I changed them around, it gave me an error stating:

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

So I swapped them back to the exact code that I had used to pass it and it's still giving me an error. I'll list the script.js and then the stylesheet.css.


$(document).ready(function(){

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

});

div {
    border-radius: 5px;
    background-color: #ABCDEF;
    transition: background-color 0.5s ease;
    display:inline;
    font-size:25px;
    padding:20px;
    border:1px solid #ccc;
    margin-top:10px;
}

.active {
    background-color:#556677;
}


#2

@princebatcat,
Have you tried a refresh Browser

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#3

Yup. Didn't help. The only thing that I didn't try was using another browser.


#4

Do you still need help or you managed to pass ?


#5

I managed to pass, I was just wondering why it was giving me the error. Might've been a bug. I'll go back and try it again here in a moment.


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.