@@ -55,22 +51,27 @@
let pro = (window.pageYOffset / totalHight) * 100
Prostick.style.width = pro + '%'
})
- document.addEventListener("DOMContentLoaded",function(){
- let imgs =[];
+ document.addEventListener("DOMContentLoaded", function () {
+ let imgs = [];
const carouselImages = document.querySelector('.banner img');
const dotsContainer = document.querySelector('.dots-container');
let currentIndex = 0;
- })
- document.addEventListener("DOMContentLoaded",function(){
- let newszyLis = [];
- const liContent = document.querySelector('.newszy li');
- document.write(`
${newszyLis.text} `)
- })
- document.addEventListener("DOMContentLoaded",function(){
- let newsInfo = [];
- const pContent = document.querySelector('.newsinfo p');
- document.write(`
${newsInfo.text}
`)
- })
+
+ const newszyLis = [
+ { text: "新闻示例1" },
+ { text: "新闻示例2" },
+ // ...更多新闻项
+ ];
+ const liContent = document.querySelector('.newszy ul');
+
+ newszyLis.forEach(item => {
+ const li = document.createElement('li');
+ li.textContent = item.text;
+ liContent.appendChild(li);
+ });
+
+ });
+