6. hover - bug?


#1


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


Hey, is there a bug with this exercise? or am I doing something wrong?

tried in mozila chrome and IE


$(document).ready(function(){

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

});.


#2

This period/full stop at the end is causing the error. Remove . from the end


#3

It's working fine.....remove the period (.) at the end of the code


#4

Its not that, the period is only at the post,
The period isn't in my code

thats the exact code :

$(document).ready(function(){

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

},

function(){
    $(this).removeClass('active');
}

);

});


#5

getting this error:
Oops, try again. Please follow the instructions on the Full Preview page to test your code.

Thanks alot for the help


#6

Try this...

$(document).ready(function(){

$('div').hover(
function(){
$(this).addClass('active')

},

function(){
$(this).removeClass('active')
}
);

});


#7

its working, like my code, but now I'm getting this error:

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

Still can't continue to the next exercise... :frowning:


#8

Solved! :slight_smile:

I had to wait 2 seconds on the div and then 2 seconds outside the div and it worked


6. Hover: My code functions correctly but it tells me I'm wrong
#9

Ya....I did the same it worked......:slight_smile:


#10