imgHead = [
'images/main-bg1.jpg',
'images/main-bg2.jpg',
'images/main-bg3.jpg',
'images/main-bg4.jpg',
];
i=1;
function csaHead(){
if(i > (imgHead.length-1)){
i = 0;
}
$('.page-homepage').animate({'opacity':'1'},1200,function(){
$('.page-homepage').css({'background':'url('+imgHead[i]+')'});
i++;
});
$('.page-homepage').animate({'opacity':'1'},1200);
}
var intervalCsaHead = setInterval(csaHead,1000);
<div class="modal fade bs-example-modal-lg" .......>
<div class="modal-dialog modal-lg">