提交修改

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

@ -559,21 +559,22 @@
var noticeInner = document.querySelector('.notice__inner');
var noticeItems = Array.from(document.querySelectorAll('.notice__item'));
var currentIndex = 0;
function showCurrentNotice() {
var numToShow = Math.min(currentIndex + 1, noticeItems.length);
for (var i = 0; i < noticeItems.length; i++) {
noticeItems[i].style.height = '';
}
for (var i = 0; i < numToShow; i++) {
noticeItems[i].style.height = 'auto';
if (noticeItems.length > 1) {
function showCurrentNotice() {
var numToShow = Math.min(currentIndex + 1, noticeItems.length);
for (var i = 0; i < noticeItems.length; i++) {
noticeItems[i].style.height = '';
}
for (var i = 0; i < numToShow; i++) {
noticeItems[i].style.height = 'auto';
}
noticeInner.style.transform = "translateY(" + ((-noticeItems[currentIndex].clientHeight * currentIndex)*1.39) + "px)";
noticeInner.style.transition = "all 2.5s";
noticeInner.scrollTop = noticeItems[currentIndex].offsetTop;
}
noticeInner.style.transform = "translateY(" + ((-noticeItems[currentIndex].clientHeight * currentIndex)*1.39) + "px)";
noticeInner.style.transition = "all 2.5s";
noticeInner.scrollTop = noticeItems[currentIndex].offsetTop;
showCurrentNotice();
}
showCurrentNotice();
if (noticeItems.length > 1) {
setInterval(() => {
currentIndex = (currentIndex + 1) % noticeItems.length;
showCurrentNotice();

Loading…
Cancel
Save