6. Hover


#1


Hey guys! Not quite sure why my code will work, followed the template.


I get this error message: "It doesn't look like your background colour changed, is your hover adding the class active?"
- however, my background colour does change!


$(document).ready(function(){

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


#2

Timing could be the only issue. There is a delay in the lesson check.

  • submit
  • hover on a div and hold two seconds
  • mouse off and pause another two seconds
  • return to editor

#3

Thanks so much! It worked, can be impatient sometimes.


#4

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