im trying to make dynamic backgrounded page. im using the code below;
function loadBackground() {
$.ajax({
url: 'getimages.php',
success : function(filename) {
$('html').css('background', 'url('+filename+') no-repeat center center fixed');
$('html').css('-webkit-background-size', 'cover');
$('html').css('-moz-background-size', 'cover');
$('html').css('-o-background-size', 'cover');
$('html').css('background-size', 'cover');
}
});
}
with: body onLoad="setInterval(loadBackground, 10000);"
im using this because auto change in 10 seconds.
here is getimages.php file:
$files = glob('server/php/files/*.*');
$file = array_rand($files);
echo $files[$file];
but it change images directly without smooth transition. how to make smooth transition for background pictures?
best regards.