Northernlights Northernlights - 1 year ago 97
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.

Answer Source

You can probably use the not[doc] selector

$("#id").click(function() {
    $('.swoosh div:not(.template)').fadeOut('fast');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download