hey guys im trying to append html to a div but in delayed times creaded by the variable delay_time
- notification.delay(delayed_time).show("slow");
works with no delay change between appended html and
- notification.delay(delayed_time, function(){ // doesnt work
notification.show("slow");
});
just doesnt work
- $(document).ready(function(){
$.ajax({
dataType: "json",
url: "http://127.0.0.1/scripts/json.php",
success: function(data) {
var i = 0;
$.each(data, function(type, message)
{
i++;
var delayed_time = (1500 + (500 * i));
var notification = $( ".notification-container" ).append( "<span class='" + type + " notification'>" + message + "</span>").hide();
//notification.delay(delayed_time).show("slow"); // works with no delay difference
notification.delay(delayed_time, function(){ // doesnt work
notification.show("slow");
});
notification.delay(2000).fadeOut(300, function(){
$(this).remove();
});
});
}
});
});
thank you