2

Found few solution in here but non of them is the same as mine problems:

$('.listed-Item-Table').not(spesificItem).fadeTo('fast',0.2).hide(1000);

I got around 20 objects that are been hide. After this hiding effect i ended i was to add some object into the DOM and show them.

while doing the following:

    $('.listed-Item-Table').not(spesificItem).fadeTo('fast',0.2).hide(1000 , 
      function(){
        addDetilsBox(spesificItem);
     });

I do add the object only after the hiding effect is done , but i'm adding him 20 times.

How should i wait until the hiding effect is over for all of the 20 items and only then add 1 object to the DOM?

USer22999299
  • 5,284
  • 9
  • 46
  • 78
  • 5
    possible duplicate of [jQuery, calling a callback only once after multiple animations](http://stackoverflow.com/questions/2432267/jquery-calling-a-callback-only-once-after-multiple-animations) – Shai Oct 17 '14 at 12:56
  • 2
    re the duplicate: in particular, be sure to check the alternative solution linked from there ([jQuery $.animate() multiple elements but only fire callback once](http://stackoverflow.com/questions/8793246/jquery-animate-multiple-elements-but-only-fire-callback-once)) – Shai Oct 17 '14 at 12:57

1 Answers1

4

use promise().done() in jquery

$('.listed-Item-Table').not(spesificItem).fadeTo('fast',0.2).promise().done(function(){

// call back code
});
Balachandran
  • 9,567
  • 1
  • 16
  • 26