I would
1) pre-load the image so that it is ready before the ajax requests starts
2) show the gif in the #newsContent element instead of the #bo element. This would automatically stop the loading gif by overwriting the #newsContent in the success callback
Code:
$(document).ready(function() {
var myImage = new Image();
myImage.onload = function() {
// here the image has finished loading
$.ajaxSetup({
beforeSend: function() {
$('#newsContent').append(myImage);
}
});
$.ajax({
...
success: function(r) {
$('#newsContent').html(r);
},
...
});
};
myImage.src = 'pics/loadingAnimation.gif';
});