12. ....And Get Yourself Out "Oops. Try Again......"


#1



https://www.codecademy.com/courses/web-beginner-en-bay3D/2/4?curriculum_id=50a3fad8c7a770b5fd0007a1#


My code looks right, I went over everything and it seems like nothing is missing, but the error message says there is. The error message I keep getting is: "Oops, try again. It looks like you didn't set your div's opacity to 0.5. Check the example above in the instructions if you need help!"

Below is my code:


$(document).ready(function() {
   $('div').mouseenter(function() {
        $('div').fadeTo('fast', 1);
   });
$('div').mouseleave().fadeTo('fast', 0.5);
});


#2

Function missing:

$('div).mouseleave(function(){
 $('div').fadeTo('fast', 0.5);
});

#3

Thanks! Whew, JQuery is confusing at first. Way different then JavaScript. :joy:


#4

to me, this looks cleaner:

$('div')
.mouseenter(function(){
    $(this).fadeTo('fast', 1.0);   
})
.mouseleave(function(){
   $(this).fadeTo('fast', 0.5);
});

#5

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