#6 Hover


#1

Frustrated. The code works but the program is not allowing me to move on. What am I doing wrong?
$(document).ready(function(){

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

});


#2

Well, two things, actually. One, your posted code is not pre-formatted, making it look like a grocery list (please learn how to pre-format posted code samples), and two, did you take your time through the process?

This exercise has a timing element involved. First we submit, then read and follow the instructions in the full screen view (they are near the Return to Editor button) and at each step, pause two seconds so the test program can catch up. Network latency can have this effect on AJAX interactions. We just need to take our time going through the steps.


#3

I'm not clear on your first comment. As to your second comment, I followed the steps,I viewed the code in the full screen view mode, but I kept getting a error message for something that was seamly correct. Eventually, the codes was accepted and I was able to progress. However, I still don't know what the hang-up was.

Thanks for your reply!


#4

same problem=/ code is correct but it wont move on


#5

@ruth3070 @cloudslayer05431 I was having the same problem. Your code is correct. I found if you hover over one of the div tags, wait a few seconds, and then move your mouse off of the div tag then it will let you move on.


#6

Thx, this works, but the behavior of code checker can make people think they've made a mistake... Should be fixed.


#7

Fixing it may be harder than we think. As I see it, this may be a network latency issue since it is not confined to one user agent. While I am just guessing, if there is an AJAX component to the lesson checker, then the network comes into play.


#8

Thank you. I'll try your suggestion.


#9

I think that your comment is very logical. That makes total sense.


#10

When you go full screen, there are instructions bellow and if you follow them it'll let you move on, first you put you mouse in the div until the message at the button tells you to remove it, once that's done you can move on.


#11

I did as you said. Kept the mouse inside the div for more than a few seconds and then stopped hovering and it worked. Thx!


#12

I think you should put single parenthesis instead of double then it will be ok.
$(this).addClass('active'); and also $(this).removeClass('active');


#13

Thanks webslayer for your comments. I appreciate that you took took time to give your feedback.

I found out that my code was correct, and I agree with the comment that @mtf made about network latency. I suspect that this was the culprit of what I was experiencing.

I read somewhere that only double-quoted strings perform string interpolation, but that single-quotes work everywhere else. With few exceptions, many other languages (including Ruby) using double-quotes or single-quotes is a matter of personal preference. I'm finding that using double quotes as a top-tier and single quotes as a second tier is working out better for me.


#14

I cant get past this still. how long do I stay in the div before moving out?


#15

worked after several refreshing of browser


#16
  1. Click in the window
  2. Mouse over a div
  3. Pause at least two seconds
  4. Mouse off div
  5. Pause two seconds
  6. Repeat 2 to 5 on other divs (if present)
  7. After a pause, Return to Editor

#17

Tell me please!
After it worked, errors no more? I still have the error (


#18

zahariya. It worked for me, but I had to type cntrl+0 and refresh my screen first. Also, when you're on a roll and buzzing through the lessons, there seems to be some network latency. So, when saving and submitting your code, don't rush through the steps. Give it some time to catch up. If it's still not working double check your syntax. Good luck and don't give up!


#19

really thanks! when I come to thoes problems next time, maybe this method would work too!


#20

hey,friends,you can try to move out from "div" slowly,and watch the navi bar bottom the window.