I have this code :
$(\'.hotel_photo_select\').fadeOut(500, function () {
alert(\"Now all \'.hotel_photo_select are hidden\'\");
});
and
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'");
});