|
|
|
@ -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();
|
|
|
|
|