apply class and removing it after miliseconds code example
Example: apply class and removing it after miliseconds
$('.box').on('click', function(){
var self = $(this);
self.addClass("bg1");
setTimeout(function(){
self.removeClass("bg1");
}, 500);
});