$("#element").addClass("myclass").on('webkitAnimationEnd oanimationend msAnimationEnd animationend',
function (e) {
$("#element").addClass('text-success');
$("#element2").addClass('myclass2');
setTimeout(function () {
$("#element").fadeOut("slow", function () {
$("#element").remove();
});
}, 60000);
});
This code functions correctly when the tab is active. However, if the tab becomes inactive, the code will pause at the 'on' event.
Does anyone have any suggestions on how to make this code work even if the tab is inactive, so that when switching back to the tab everything appears as it should?