i have a jquery ajax request. On page load a loading-image is displayed. this is working well, but i want to display the loading gif for a minimum of 1 second.
I've already tried this: Ajax loader image: How to set a minimum duration during which the loader is shown? , but it's not working.
My code is:
<div id="ajaxcontent"><img src="loader.gif" id="ajaxloading" /></div>
and
$.ajax({
// some code for the request
success: function () {
$('#ajaxcontent').text(myResultText);
}
I've also tried to add .delay(1000) before the text is shown, but this also does not work.