[jQuery] Re: Issue with addClass and removeClass

2009-02-25 Thread Mauricio (Maujor) Samy Silva
You must re-bind the click event to the classes every time you change it. Use the newest live () method added in 1.3 version of jQuery library [1]. $(document).ready(function() { $('.large').live("click", function(){ ... and $(document).ready(function() { $('.small').live("click", function

[jQuery] Re: Issue with addClass and removeClass

2009-02-25 Thread MorningZ
It's because you are expecting the 's events to change when you add/remove the class... that certainly is *not* the case as your code wires up the 's to their respective events one single time, on document.ready if you want to change the events on the fly, use the ".live" version or better y