Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Mattias Campe Newsgroups: comp.lang.javascript Subject: jQuery: fadeIn/out + count Date: Wed, 12 Mar 2014 16:09:36 +0100 Organization: A noiseless patient Spider Lines: 22 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 12 Mar 2014 15:09:35 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="6cbb2381760f6022fd52a5fb571307a4"; logging-data="11446"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lyJp2JXpIGq983zjzWBfq" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 Cancel-Lock: sha1:3T+QqcWMt+tjNq4ENriJjo6GdrI= Xref: csiph.com comp.lang.javascript:23573 Hello I got multiple paragraphs and some of them need to have a fadeIn, some a fadeOut. After that code I want to count the paragraphs that are still visible. The fadeIn or fadeOut works as I expect, but not the counting. I guess that is because the animation is still busy, while the counting already starts. A kind of "parallel" processing. Would anybody know if that is the cause and/or a solution for my problem? if (jQuery('input#' + geg).is(":checked")){ jQuery("p." + geg).fadeIn(); } else { jQuery("p." + geg).fadeOut(); } var nSr = eval(jQuery('p.sr:visible').length); // BUG? Kind regards Mattias