Try out .not, like: $('.test').click(function(){ $('.test').not(this).animate(ANIMATION_FOR_OTHERS); $(this).animate({left:'0'},'slow'); });
On 3/31/07, joomlafreak <[EMAIL PROTECTED]> wrote:
I am not a programmer by profession, but a surgeon and doing a lil bit of programming is my hobby. Ok, my question is how do I select and apply function etc to all but one element. For example I have 3 divs with a class test. Each of these have an individual id, say itemId1,itemId2,itemId3. Now I want to write code like this $(document).ready(function(){ $('.test').click(function(){ $(this).animate( {left:'0'}, 'slow' ); }); }); The animate gets applied to all three divs. But what I want to do is to apply this animate effect to only one that is clicked and at the same time some other animate effect to the other two which are not clicked. How do I select the other two divs and apply another animate function on those two divs? I thought about it and tried many ways but nothing worked. Any help to this novice would be appreciated with high regards. thanks