[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Jonathan Sharp
Do you have a url to a sample page we could look at? -js On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote: Thanks Jonathan Almost but still not working $('.collapsible .collapsed').bind('click', function() { $(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsi

[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Mario Moura
Thanks Jonathan Almost but still not working $('.collapsible .collapsed').bind('click', function() { $(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen'); }); I said too I have many .collapsible .collapsed classes so I cant change all at the same time. Id

[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Jonathan Sharp
The issue lies in that you're trying to bind your click event to .collapsibleopen at document ready time. The .collapsibleopen class won't be available until the user clicks to have it added. I think below is more of what you're after... $('.collapsible .collapsed .collapsibleopen').bind('click',

[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Ganeshji Marwaha
I am not sure what i am telling is right or not, but try $(this).removeClass().addClass("collapsible").addClass("collapsed"); If you think this couldn't be the problem ignore this message. -GTG On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote: yes, But still not working. Strange behavior. I

[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Mario Moura
yes, But still not working. Strange behavior. I guess or I need study more. :) $(document).ready(function(){ $(".collapsible .collapsed").click(function(){ $(this).removeClass().addClass("collapsibleopen"); }); $(".collapsibleopen").click(function(){ $(this).removeClass().

[jQuery] Re: switch between two class - Basic Issue

2007-07-25 Thread Eric C
shouldn't your line: $("collapsibleopen").click(function(){ be $(".collapsibleopen").click(function(){ ? On Jul 25, 3:28 pm, "Mario Moura" <[EMAIL PROTECTED]> wrote: > Hi Folks > > I am trying switch between two class > > Is it possible? > > $(document).ready(function(){ > > $(".collapsible .c