Hello everyone!
I have this function
var tdM = new Array($('#todoMessageArea'), $('#todoMessageArea2'));
var tdMC = new Array('errorM', 'successM');
function setAlertMessage ( message, suc ) {
tdM.each(function(el){
el.addClass(tdMC[suc]);
el.fadeIn('slow', function() {
el.html(message);
});
setTimeout(function(){
el.fadeOut().delay(3000);
el.html('');
el.removeClass(tdMC[suc]);
}, 10000);
});
}
For the 2 Arrays, the first holds two paragraphs and the second class names to be applied, in the function the first parameter is a message and the second an integer, when I call the function nothing happens and also no errors are displayed in firebug, is it not possible to handle things the way I am doing or do I have to do it some other way?