Northernlights Northernlights - 5 months ago 11x
HTML Question

How to fade all divs in a container except one with jQuery?

I've got this:

$("#id").click(function() {
$('.swoosh div').fadeOut('fast', function(){

is the container div, and
is the div that i want to remain when i click on
, while all other divs inside

I feel a bit silly, but I've played around for ages to no avail. Please help a brother out.


You can probably use the not[doc] selector

$("#id").click(function() {
    $('.swoosh div:not(.template)').fadeOut('fast');