Sorry I could not find this.
$('div#loader').slideDown("fast").delay(1.5);
Does not word as expected, I want it to slideDown, then stay in that mode for 1.5 seconds and then the load function which happens very fast and then it slides up using fast. I thought delay(); was the correct approach.
Full function for those who wish to see:
$(document).ready(function () {
function last_msg_funtion() {
var ID = $(".pic_box:last").attr("id");
$('div#loader').slideDown("fast").delay(1.5);
$.post("/?action=get&id=" + ID,
function (data) {
if (data!="") {
$(".pic_box:last").after(data);
}
$('div#loader').slideUp("fast");
});
};
});
You could define a
waithelper function and run your code after waiting for 1.5 secs:The
waitfunction makes your code reads better IMO