提交修改

new-v20240713
dshclm 8 months ago
parent 7545137dcd
commit f34f7d0ce0

@ -559,6 +559,7 @@
var noticeInner = document.querySelector('.notice__inner'); var noticeInner = document.querySelector('.notice__inner');
var noticeItems = Array.from(document.querySelectorAll('.notice__item')); var noticeItems = Array.from(document.querySelectorAll('.notice__item'));
var currentIndex = 0; var currentIndex = 0;
if (noticeItems.length > 1) {
function showCurrentNotice() { function showCurrentNotice() {
var numToShow = Math.min(currentIndex + 1, noticeItems.length); var numToShow = Math.min(currentIndex + 1, noticeItems.length);
for (var i = 0; i < noticeItems.length; i++) { for (var i = 0; i < noticeItems.length; i++) {
@ -573,7 +574,7 @@
} }
showCurrentNotice(); showCurrentNotice();
if (noticeItems.length > 1) {
setInterval(() => { setInterval(() => {
currentIndex = (currentIndex + 1) % noticeItems.length; currentIndex = (currentIndex + 1) % noticeItems.length;
showCurrentNotice(); showCurrentNotice();

Loading…
Cancel
Save