I think this is happening because you are selecting multiple items (
.popup:not([data-info="xyz"])) and are invoking the callback for each one. When one of these is already faded the first callback seems to trigger immediately, meanwhile the one that is visible fades and then makes the callback, which has already been actioned. You could try adding a
visible filter too:
- $('.additionalInfo li').click(function() {
- var thisPopup = $(this).data('id');
- $('.popup:not([data-info="' + thisPopup + '"]):visible').fadeOut(250, function() {
- $('.popup[data-info="' + thisPopup + '"]').fadeIn(350);
- });
- });