I'm trying to hide some How can I change this so that everything is listener, but there is no div.dropdown_container or any child element in it? should do this. So it checks whether a click is generated or clicked on any of its children. li element when clicking any element on the page Gets them or their containers (
div.dropdown_container ) I can not get it to work though.
$ ("body"). ("Click", "*: no (div.dropdown_container, div.dropdown_container> *)", function (e) long before `` li` / / does not want to hide it, it would span I always want to show $ ("ul.dropdown_ul> li: not (#first)"). Hide ();});
e.target gets the element you clicked on.
$ ("body"). ("Click", function (e) {if ($ (e.target) .is ('div.dropdown_container') || $ (e.target) .closest ('div.dropdown_container'). Length) {/ / Do something else else {// do something else}});
No comments:
Post a Comment