Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23579

Re: jQuery: fadeIn/out + count

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.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 <mattiaspuntcampe@geeeemeil.com>
Newsgroups comp.lang.javascript
Subject Re: jQuery: fadeIn/out + count
Date Wed, 12 Mar 2014 21:17:12 +0100
Organization A noiseless patient Spider
Lines 45
Message-ID <lfqfc8$10r$1@dont-email.me> (permalink)
References <lfptbf$b5m$1@dont-email.me> <4u31i91v4vk1gsc4bum84ggjk3ojc1kq00@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 12 Mar 2014 20:17:12 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="6cbb2381760f6022fd52a5fb571307a4"; logging-data="1051"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198EwztVT05X3qz6ERyn7IL"
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <4u31i91v4vk1gsc4bum84ggjk3ojc1kq00@4ax.com>
Cancel-Lock sha1:Eg0Jj8Lpqi/OTbESdILMQGgJAXI=
Xref csiph.com comp.lang.javascript:23579

Show key headers only | View raw


op 12-03-14 17:50, Hans-Georg Michna schreef:
> On Wed, 12 Mar 2014 16:09:36 +0100, Mattias Campe wrote:
>
>> 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?
>
> I thought one does this with CSS3, instead of using a monster
> like jQuery.

Thank you for your answer. The code above is for an end user who has a 
long list of things and he wants to filter it, by ticking checkboxes on 
or off.

Now I would like to inform that user how long the list still is. So 
that's why I use "jQuery('p.sr:visible').length)", which doesn't give 
the correct answer. I guess that is because the animation is still busy, 
while the counting already starts. A kind of "parallel" processing. But 
I don't know the solution to that.

If the solution would be possible in CSS3: I would love to know. It 
doesn't have to be in JQuery.

> Not to mention that having something fade in or out only serves
> to slow down the user, but that's a more basic question.

I tried it without animation, but then the end user doesn't notice it 
that easy that the list changes.

Kind regards
Mattias

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

jQuery: fadeIn/out + count Mattias Campe <mattiaspuntcampe@geeeemeil.com> - 2014-03-12 16:09 +0100
  Re: jQuery: fadeIn/out + count Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2014-03-12 17:50 +0100
    Re: jQuery: fadeIn/out + count Mattias Campe <mattiaspuntcampe@geeeemeil.com> - 2014-03-12 21:17 +0100
      Re: jQuery: fadeIn/out + count Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-03-12 18:04 -0300
        Re: jQuery: fadeIn/out + count Mattias Campe <mattiaspuntcampe@geeeemeil.com> - 2014-03-13 20:22 +0100
  Re: jQuery: fadeIn/out + count Christoph Michael Becker <cmbecker69@arcor.de> - 2014-03-13 02:05 +0100
    Re: jQuery: fadeIn/out + count Mattias Campe <mattiaspuntcampe@geeeemeil.com> - 2014-03-13 20:31 +0100

csiph-web