How to call a function after a fadeOut() on many elements

You can use the promise() method for this (the doc page has a good example for this).

The .promise() method returns a dynamically generated Promise that is
resolved once all actions of a certain type bound to the collection,
queued or not, have ended.

Applied to your example should be something like this:

$.when(
    $('.hotel_photo_select').fadeOut(500)
).done(function() {

    alert("Now all '.hotel_photo_select are hidden'");

});

OR

$('.hotel_photo_select').fadeOut(500)
    .promise().done(function() {
        alert('Got this far!');
    });

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)