T
T
tarthur2018-01-29 21:22:15
JavaScript
tarthur, 2018-01-29 21:22:15

Jquery. One callback after multiple hiding?

There is such a code: https://codepen.io/anon/pen/VQwyoO
The fact is that by hiding all these elements, the same callback is launched for each. For example, 100 elements - 100 callbacks, why? I do not need to call 100 identical callbacks (and the code in other scripts does not work correctly). You only need to execute 1 function after all the elements are hidden.
What does jquery provide for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-01-29
@tarthur

You can use $.when like this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question