How can I fire an event if a CSS class is added or changed using jQuery?
Does changing of a CSS class fire the jQuery change() event?
if you know a what event changed the class in the first place you may use a slight delay on the same event and the check the for the class. example
//this is not the code you control
$('input').on('blur', function(){
$(this).addClass('error');
$(this).before("Warning Error");
});
//this is your code
$('input').on('blur', function(){
var el= $(this);
setTimeout(function(){
if ($(el).hasClass('error')){
$(el).removeClass('error');
$(el).prev('.someClass').hide();
}
},1000);
});
http://jsfiddle.net/GuDCp/3/