To remove class after delay in jQuery you can use one of the snippet below.

Samples

jQuery Sample using setTimeout()

var element = $('#element');
element.addClass('current');
setTimeout(function() {
	element.removeClass('current');
}, 2500);

Samples

jQuery Sample using delay() and queue()

$("#element").addClass("testclass").delay(2500).queue(function(next){
    $(this).removeClass("testclass");
    next();
});

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

4 thought on “How to remove class after delay in jQuery”

Leave a Reply