[jQuery] Re: Calling seperate function in each()

2008-10-20 Thread XeroXer
I have returned with yet another question. If I want to collapse all the other menu items before expanding the clicked one I tried using this: ... .bind('showme', function() { $("a.Category").trigger("showme"); $(this).data("hidden", false).parent("li") .css({background: "#00ff00"}).children("ul")

[jQuery] Re: Calling seperate function in each()

2008-10-14 Thread XeroXer
Thank you very much, that worked like a charm. On Oct 13, 11:15 pm, Dave Methvin <[EMAIL PROTECTED]> wrote: > How about this? It creates a couple of custom events (showme and > hideme) that you trigger to set the state, and the click event just > delegates to the right one based on the current st

[jQuery] Re: Calling seperate function in each()

2008-10-13 Thread Dave Methvin
How about this? It creates a couple of custom events (showme and hideme) that you trigger to set the state, and the click event just delegates to the right one based on the current state. I just triggered a click on CollapseAll to set the initial state; if you didn't want the coloring to be there

[jQuery] Re: Calling seperate function in each()

2008-10-12 Thread XeroXer
The markup will be generated from a MySQL database using PHP so it could look in many different ways. But as I have it now: [+expand] | [-collapse] category 1 category 1 1 f

[jQuery] Re: Calling seperate function in each()

2008-10-12 Thread Dave Methvin
There is a lot of similar-looking code there. You could use .toggle() but the added complication of OpenAll/CloseAll makes that tough. What does your markup look like?