Jquery 12.toggling question need help


#1

Hi I am hitting a wall in q12
here is my code
$("document").ready(function(){
$(".pull-me").click(function(){
$('.panel').slideToggle('slow');
});
});
and when i submit am getting an error like
oops, did you pass ".panel" to $() to make it jquery object
would appreciate any help
thanks


#2

@buufis,

Did you try using ".panel" with the double-quote's-"


#3

Hi Ahmed,

The error message in this case is a bit misleading :) You need to remove the quotes from around document on line 1. With quotes, jQuery is trying to select the nonexistent <document> tag from the HTML file. Without quotes, jQuery knows that you mean the page :)


#4

i tried both with double quotes and single quotes no change still it says did you pass .panel to $() to make it jquery object


#5

@buufis Those aren't the problem, see my post above.


#6

@zystvan i also removed quotes from document tag still same error


#7

@zystvan $(document).ready(function(){
$(".pull-me").click(function(){
$(".panel").slideToggle('slow');
});
});


#8

@buufis That code works fine for me. It might be that your browser is sending along cached code or something, could you try in a different browser please?


#9

@buufis,

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#10

@zystvan @leonhard_wettengmx_n
no change tried diff browser, reset both code and browser i think there is a bug in the question i researched the forum and found prev complaints about the code


#11

I would disagree since your code worked fine for me. I'm pretty sure this is some sort of glitch on your end, I'm just not sure what the problem is :confused:
If you ever get past this exercise, would you be able to make a post here about how you got through the exercise? I'd like to know :)

And until then, sometimes issues get caused by browser zoom (make sure it's set to 100%) and browser extensions (try disabling them all)

But yeah, sorry I'm not able to help more, I just don't really know what's going on here :(


#12

@zystvan
I will let you know if i ever crack this lol! but still am not sure what else i can do
anyway thanks for your help
take care


#13

@buufis,

Just out of curiosity...
Could you present the =index.html= code you are using....

edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= http://discuss.codecademy.com/t/using-backticks-to-format-your-code/3697
[extra's]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet