M
M
Maxim Grechushnikov2016-07-21 10:08:38
css
Maxim Grechushnikov, 2016-07-21 10:08:38

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

4 answer(s)
N
Nikita Shchypylov, 2016-07-21
@Nikulio

bx-slider хорошо подойдет

V
Vadim Bogomazov, 2016-07-21
@bogomazov_vadim

?

M
Mary Солнечная, 2016-07-21
@MaryT

Вот вариант для смены фона, но только не будет так плавно.
Создаете несколько классов: 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);
});

A
andwin, 2016-07-21
@romanbel

Делаем гифку и ставим как фоновую картинку

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question