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', function() { $(this).toggleClass('collapsible').toggleClass('collapsed').toggleClass('collapsibleopen'); }); Cheers, -js On 7/25/07, Mario Moura <[EMAIL PROTECTED]> wrote:
Hi Folks I am trying switch between two class Is it possible? $(document).ready(function(){ $(".collapsible .collapsed").click(function(){ $(this).removeClass().addClass("collapsibleopen"); }); $("collapsibleopen").click(function(){ $(this).removeClass().addClass("collapsible collapsed"); }); }); My first switch works but when I click in collapsibleopen (change from the previous click) didnt change. I have many .collapsible .collapsed classes so I cant change all at the same time. Ideas? Regards -- Mário