1
Привет я написал некоторые JQuery, но по какой-то причине замирания разве работаетJQuery изображения увядают разве работает
$(document).ready(function() {
var img_array = [1, 2, 3, 4],
newIndex = 0,
index = 0,
interval = 7500;
(function changeBg() {
// newIndex = Math.floor(Math.random() * 10) % img_array.length;
// index = (newIndex === index) ? newIndex -1 : newIndex;
index = (index + 1) % img_array.length;
$('.main-wrapper').css('backgroundImage', function() {
$('#cycler').fadeIn({
backgroundColor: 'transparent'
}, 0, function() {
setTimeout(function() {
$('#cycler').fadeToggle({
backgroundImage: 'url(http://dev.test.co.uk/Content/H/images/bg1.png)'
}, 2500);
}, 4000);
});
return 'url(http://dev.test.co.uk/Content/H/images/bg' + img_array[index] + '.png)';
});
setTimeout(changeBg, interval);
})();
});
кто-то может пролить некоторый свет на это, пожалуйста,
HTML только на самом деле это Theres некоторое содержание в средний, но только часть текста
<section id="cycler" class="main-wrapper"></section>
и КСС:
#cycler{
position:relative;
}
#cycler img{
z-index:1
}
#cycler img.active{
z-index:3
}
.main-wrapper
{
overflow-x: auto;
margin-left: auto;
margin-right: auto;
height: 1822px;
background-image: url(../H/images/bgone.png);
background-size: cover;
background-repeat: no-repeat;
}
любая помощь хороша
Благодаря