**
- 1
- 2
- 3
- 4
- 5
- 6
<
>
if (index == 0) {
index = 6
}
$(".adver").css("background", "url(./images/adver0" + index + ".jpg)");
$("li").eq(index - 1).css("backgroundColor", "orange").siblings().css("backgroundColor", "#333");
});
$(".arrowRight").click(function (e) {
index++;
console.log(index);
if (index == 7) {
index = 1
}
$(".adver").css("background", "url(./images/adver0" + index + ".jpg)");
$(".adver li").eq(index - 1).css("backgroundColor", "orange").siblings().css("backgroundColor", "#333");
});
$(".adver li").click(function () {
index = $(this).index() + 1;
console.log($(this));
$(this).css("backgroundColor", "orange").siblings().css("backgroundColor", "#333");
$(".adver").css("background", "url(./images/adver0" + index + ".jpg)");
})
setInterval(() => {
index++;
index = index == 7 ? 1 : index;
index = index == 0 ? 6 : index;
$(".adver").css("background", "url(./images/adver0" + index + ".jpg)")
$(".adver li").eq(index - 1).css("backgroundColor", "orange").siblings().css("backgroundColor", "#333")
}, 1500);
})