Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
0fuling0 committed Feb 9, 2025
1 parent 2895984 commit 0e224fd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ document.addEventListener('DOMContentLoaded', function () {

// 首先初始化基本功能
updateClock();
initBackgroundImage();

// 加载配置
fetch('config.json')
Expand All @@ -42,11 +41,9 @@ document.addEventListener('DOMContentLoaded', function () {
// 从配置文件加载图片数组
if (config.backgroundImages && Array.isArray(config.backgroundImages.images)) {
backgroundImages = config.backgroundImages.images;
// 立即初始化背景图片
initBackgroundImage();
// 启动背景图片轮播
startBackgroundSlideshow();
}
initBackgroundImage();
startBackgroundSlideshow();

if (config.carousel && Array.isArray(config.carousel.images)) {
carouselImages = config.carousel.images;
Expand All @@ -72,7 +69,6 @@ document.addEventListener('DOMContentLoaded', function () {
.catch(error => {
console.error('Error loading configuration:', error);
});
startBackgroundSlideshow();
});

// 初始化背景图片
Expand Down Expand Up @@ -919,7 +915,6 @@ function refreshBusuanzi() {
}
}

// DOM内容加载完成时的事件处理
document.addEventListener('DOMContentLoaded', function () {
// 初始化基本功能
updateClock();
Expand Down

0 comments on commit 0e224fd

Please sign in to comment.