javascript - Is my jQuery syntax wrong here? -
I'm learning jQuery and I think this code is not working:
< Code> & lt; Script type = "text / javascript" & gt; $ (Document) .ready (/ * Navigtion Stuff * / function () {$ ('. Menu ul'). Hover (function () {$ (this) .Parent (.) AddClass ("active");}, AddClass ("active") ("$") ("$"). );}); & Lt; / Script & gt;
The first thing that does it is considered. Is not my function bad, is my syntax bad? If not, I thought my code is conflicting with some other javascript on the page.
Thanks in advance!
There is some confusion with your bracket
$ (document) .ready (/ * Navigtion Stuff * / function () {$ ('. ("Active");}, function () {$ (this) .Parent (). RemoveClass ("active");}); $ ( "Menu"). Parent ("li"). AddClass ("active");});
Better.
Comments
Post a Comment