i didn't get any error message, its work fine, but this code its for tree menu when i click on item one its open the tree and when i click on another item its still open tree one and open tree two, what i want on click on another item hide all tree and open tree what i clicked.

system
—
2011-12-07T00:19:33Z —
#4

oh ok.

For me it's a lot easier and I would use less code by doing it with plain javascript, rather than with jquery. Hopefully someone else will come long if you must use jquery.

Paul_Wilkins
—
2011-12-07T23:16:36Z —
#5

jone_kent said:

i didn't get any error message, its work fine, but this code its for tree menu when i click on item one its open the tree and when i click on another item its still open tree one and open tree two, what i want on click on another item hide all tree and open tree what i clicked.

The standard way to achieve this is to first close everything and then to open the one that was clicked.

jone_kent
—
2011-12-08T08:29:36Z —
#6

paul_wilkins said:

The standard way to achieve this is to first close everything and then to open the one that was clicked.

Thanx for replay, so how to do this????

system
—
2011-12-08T09:10:41Z —
#7

jone_kent said:

Thanx for replay, so how to do this????

You can loop through all the elements first and set their display style to none and then set the display style of the clicked one to block.

Paul_Wilkins
—
2011-12-08T09:36:47Z —
#8

webdev1958 said:

You can loop through all the elements first and set their display style to none and then set the display style of the clicked one to block.

Bad webdev, he's using jQuery for his existing code so he might as well continue to benefit from the library that he's currently using.

He can loop through all of the elements that have an id starting with "parent_"In that loop he can check if the element has a matching id number that was initially passed in, so that different behaviour can be performed with those that match.