[jQuery] Re: fadeOut Callback Trigger Count

2009-04-20 Thread blockedmind
Thanks very much. On Apr 20, 2:19 am, Karl Swedberg wrote: > You could do something like this: > > $(document).ready(function() { >         $("#menu ul li a").click(function(e) { >                 e.preventDefault(); >                 var $sibs = $(this).parent().siblings(); >                 $s

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-19 Thread Karl Swedberg
You could do something like this: $(document).ready(function() { $("#menu ul li a").click(function(e) { e.preventDefault(); var $sibs = $(this).parent().siblings(); $sibs.fadeOut(function() { if ( $sibs.index(this) == $sibs

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-19 Thread mkmanning
You could keep a running count of how many li's have called fadeOut and store it with .data(). Here's an example storing it on the parent ul: $("#menu ul li a").click(function(e) { e.preventDefault(); var li = $(this).parent().siblings(); li.fadeOut(function() {

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-19 Thread blockedmind
Thanks for the reply firstly. :) Since I'm talking about a default jQuery function I didn't give a full example. If you think that I'd help let me give you one. I have simplified my code for the example, here it goes: http://blockedmind.com/jq/fadeout.html When you click a link, the others are d

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-19 Thread Karl Swedberg
Would you mind giving us some code to look at? Or point us to a test page? It might be easier to help you if we have something to look at. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 19, 2009, at 7:22 AM, blockedmind wrote: Hmmm... On Apr 18, 2:

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-19 Thread blockedmind
Hmmm... On Apr 18, 2:28 am, blockedmind wrote: > Nothing? > > On Apr 17, 8:46 pm, blockedmind wrote: > > > This problem occurs when $("#menu li a").fadeOut(function() {}); being > > used. callback function is called 3 times 'cos there is 3 li elements. > > > On Apr 17, 7:28 pm, blockedmind wro

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-17 Thread blockedmind
Nothing? On Apr 17, 8:46 pm, blockedmind wrote: > This problem occurs when $("#menu li a").fadeOut(function() {}); being > used. callback function is called 3 times 'cos there is 3 li elements. > > On Apr 17, 7:28 pm, blockedmind wrote: > > > Callback function of fadeOut effect is executed once

[jQuery] Re: fadeOut Callback Trigger Count

2009-04-17 Thread blockedmind
This problem occurs when $("#menu li a").fadeOut(function() {}); being used. callback function is called 3 times 'cos there is 3 li elements. On Apr 17, 7:28 pm, blockedmind wrote: > Callback function of fadeOut effect is executed once for each element > animated against. Is it possible to make