Добрый день!
Не нашла ответа в интернете.
У слайдера на первом круге при смене изображений пауза, как следствие виден задний фон. Как починить, подскажите.
<html>
<head>
<script>
function slider() {
var blocks = document.querySelectorAll('.slide'), len = blocks.length, i = 0, flag = 1;;
function hello() {
blocks[i].classList.toggle('active');
i++;
if ( i == len)
i = 0;
blocks[i].classList.toggle('active');
setTimeout(hello, 5000);
}
if ( 1 == flag )
setTimeout(hello, 5000);
}
if (window.addEventListener) {
window.addEventListener("load", slider);
} else {
window.attachEvent("on"+"load", slider);
}
</script>
</head>
<body>
<div id="slider">
<div class="slide active" style="background-image: url(https://www.google.ru/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwi1utmg99zOAhVBPSwKHUoeDEIQjRwIBw&url=http%3A%2F%2Fwww.sunhome.ru%2Fnavigator%2Fv.cvetok-lotosa&psig=AFQjCNHbOrDyaOABN5GbA72e8zs79xQa3Q&ust=1472227035411251);" >
<div>A little as 5% deposit can be saved to receive your new mortgage. Using mortgage calculators is quick and eas/</div>
</div>
<div class="slide" style="background-image: url(https://www.google.ru/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwiz8Oe199zOAhVI2ywKHcEODpoQjRwIBw&url=http%3A%2F%2Fzoo.rin.ru%2Fcgi-bin%2Findex.pl%3Fidr%3D1607%26art%3D1620&psig=AFQjCNHbOrDyaOABN5GbA72e8zs79xQa3Q&ust=1472227035411251);">
<div>A little as 5% deposit can be saved to receive your new mortgage. Using mortgage calculators is quick and </div>
</div>
<div class="slide" style="background-image: url(https://www.google.ru/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwispqHC99zOAhWCDiwKHb3pA3QQjRwIBw&url=http%3A%2F%2Fwomanadvice.ru%2Fcvetok-vyskochka-pochemu-nelzya-derzhat-doma&psig=AFQjCNHbOrDyaOABN5GbA72e8zs79xQa3Q&ust=1472227035411251);">
<div>A little as 5% deposit can be saved to receive your new mortgage. Using mortgage calculators is quick and easy.</div>
</div>
</div>
<body>
</html>