jquery - Remove visability on <li> tags except (this) on hover in a menu -


According to the topic, I can call each & lt; Li & gt;

It should be very easy for me, but I can not understand it.

This is my markup:

   

And here jQuery (which does not work):

  $ (document) .ready (function () {$ ("li"). Hover (function () ($ ("li a") No. (this). CSS ("Visibility", "hidden");});});  

Something's wrong ...

Thanks!

Your .not (this) will not work because this is a li element but you are selecting an element.

You can do it like this (added code to monitor hover):

  $ (document) .ready (function () css ("visibility "," Hidden ");}, function () ($ (" li "). Hover (function () {$ (" li a "). ($ ('A', this) {$ (" li a "CSS" ("Visibility", "Visible");});});  

In addition, you have a typo in your HTML - a ;

  • should be .


  • Comments

    Popular posts from this blog

    asp.net - Javascript/DOM Why is does my form not support submit()? -

    sockets - Delphi: TTcpServer, connection reset when reading -

    javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -