It looks like you didn't set your div's opacity to one


#1

I am stuck at exercise 11: Get Yourself In...
It keeps on saying that I 'didn't set your div's opacity to one.', even though I'm pretty sure I got it.
Here is my code:

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

Can someone please help?


Doesn't set opacity to 1
#2

Hi, Your code looks fine to me, try refreshing your page :slight_smile:


#3

maybe u just try to refresh the page. it should be work :slight_smile:


#4

I refreshed my page 2 times and the script still doesn't work. :confused:


#5

How's your HTML and CSS file and which browser. See if your browser is up to date.


#6

My HTML and CSS looks fine, and I'm using Google Chrome...


#7

Before.


After.

Google Chrome browser and it's working fine. If you use any NoScript extension on your browser then it might affect. But again that's a guess now.


#8

@fireburst Paste in your HTML and CSS


#9

change your css opacity to 1.


#10

^This is what worked for me too. Had to change the opacity in stylesheet.css


#11

@tfreeberg @jameskimaru

Hi, Nope you guys shouldn't change it in CSS, as this lesson is teaching you how to do it via jQuery.

Doing it in the stylesheet defeats the purpose of the lesson.


#12

Right, but if the page is buggy and won't let me submit valid jQuery I'm going to hack around it in order to continue the course.


#13

Here's the solution I found. The opacity argument actually accepts a float and not an int. So when the instructor states that they want you to set the opacity to 1 they actually mean to set it to 1.00, and not 1. That worked for me.


#14

JavaScript accepts both should not be a problem if it is integer or float. It has only one number type neither int nor float. But it's better not with a leading zero like 01 although it might work but not at all a good practice.


#15

A post was split to a new topic: It looks like you didn’t set your div’s opacity to one


#16