jQuery bug with opacity


#1


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

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


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


#2

After writing the code as above, hit save & submit, and pay attention to the messages shown in the bottom left-hand corner, and do as told.

I hope this helps! :slight_smile:


#3

Yeah, I think the jQuery thing is broken.


#4

Agreed - I've followed all directions. Seems to be a bug.


#5

Add code $('div').hide(); into mouse enter & mouseleave.
Done~


#6

change the opacity from 0.5 to 1 in the stylesheet.css section and then write this code in your script.js section:

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


#7

thanks Liviajuka, that works!


#8

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