We say that I have a tree of the following structure:
& lt; Div & gt; Node level1 & lt; Div & gt; Node level 2 & lt; Div & gt; Node level 3 ... etc.
Is there any such way in jQuery, if div level1 is clicked, only divs answer to level2? Click
Meaning:
$ ('div') (function () {$ ('div'). Children (first div child) .css ('color ',' Red ');})
Thanks for any input!
:: EDIT ::
All of you, thank you for your patience and input. I stubbornly went about solving this problem, and it worked. I just had to find a way to crack my tree structure and it became very clear.
I basically wanted to find a way to fall / expand the Superfish-Asc tree without getting trapped inside the "Li-Ul Li" examples, as I had seen because I thought they were a little opaque .
My solution is note: I am assuming that if some children have 0 children then they will have a link to follow. I'm sure I will be able to solve this final step with the set structure, and your capable brains.
Thank you for all help and I look forward to any feedback.
Final Note: It can easily be soft coded to agree to the size of any tree structure. A time loop that accepts children or nodes, which allows for the inclusion and calls, an aqual function may be able to drill down all the way in sub-nodes and make sure the main node is hidden They are all hidden before.
Just thought one side.
You can do this:
$ ('div' ) (Function () {$ (this). Children ('div'). CSS ('color', 'red');}); Instead of choosing all the and elements, use this
and get to the child immediately from there. Do & lt; Div & gt;
element, note this example, & lt; Div & gt;
s at the beginning of a color
, otherwise it will have a waterfall below ... even if it was not really implemented in level 3 element
Comments
Post a Comment