Answer the question
In order to leave comments, you need to log in
CSS: How to smoothly change the background?
It is required once every 10 seconds to smoothly change the background image. Only 3 pictures. Can anyone suggest how?
Google torture, but the brain does not understand.
Answer the question
In order to leave comments, you need to log in
Вот вариант для смены фона, но только не будет так плавно.
Создаете несколько классов: elements1, elements2 elements3 с фоном который вам нужен.
$(function(){
var div = document.getElementById('elements');
var count = 0;
setInterval(function() {
if ( count == 0 ) $( div ).removeClass( 'element3' );
$( div ).removeClass( 'element'+count );
count++;
$( div ).addClass( 'element'+count );
if ( count==3 ) count = 0;
}, 2000);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question