I am very new to jQuery, so I'm trying to work a small piece of code.
First of all, (after watching some tutorials) I did something similar to what I wanted to do:
& lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("content"). Hide (); Main menu ();}); Slide ("slow"); $ (This). Children ("div.content"). Slide Down ("Slow");});
It worked fine but if I clicked on an opened option then "Hide" + "Show" did the animation.
I tried to add a condition that menus wanted to do to me, but this does not work. Even now the hidden material does not work in the beginning.
The code that does not work now is:
& lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("content"). Hide (); Main menu ();}); Click the function menu () {$ (". Options") (function () {if (($ (this). Child ("div.content") (": hidden")) {$ ("" " ("Slow");. ("Slow");} and {$ ("content"). SlideUp ("slow");}})}}
Therefore, if the material is not hidden then instead of hiding it, the material should be hidden and show again.
> I do not know if I am doing this problem badly or what I am very new to this.
If someone can help me I appreciate it.
Thank you.
Edit: I lost a bracket on the statement. It's working now! BTW is very much Many thanks
looks like a typo.
If (($ (this). Child ("div.content") .is (": hidden") should be {
if ($ (This). Child ("div.content"). (": Hidden")) {
Comments
Post a Comment