Mam mały problem z animacją w jquery, mianowicie sprawa wygląda tak: mam 4 divy i dwa mają tą samą klasę i chciałbym aby jquery chował wszystkie divy oprócz this, próbowałem coś typu div:not(this), lecz to nie działa. Może ktoś z Was ma inny pomysł? Poniżej wstawiam kod źródłowy.
<head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <script type="text/javascript"> $(document).ready( function() { $('div:not(.all)').toggle( function() { alert($(this).attr("id")); $(this).animate({ height: "500", width: "500" }, 500); $('div').animate({ height: 'toggle' }, 1000) }, function() { $(this).animate({ height: "200", width: "200" }, 500); }); }); </script> <style> div.all { margin: 0 auto; width:400px; } div.one { background:red; height:200px; width:200px; float:left; } div.two { background:green; height:200px; width:200px; float:right; } </style> </head> <body> <div class="all"> </div>
Z góry dziękuje i pozdrawiam.
UPS, chyba pomyliłem działy, proszę o przeniesienie i przepraszam
