From 185b579125439c61e1d63560bd7be147b9f9a724 Mon Sep 17 00:00:00 2001 From: AviderMin Date: Wed, 30 Oct 2024 17:00:21 +0800 Subject: [PATCH] try --- WebNews/index.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/WebNews/index.html b/WebNews/index.html index 976ef30..5828135 100644 --- a/WebNews/index.html +++ b/WebNews/index.html @@ -38,9 +38,6 @@

新闻的定义

-

示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例

-

示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例

-

示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例

@@ -66,7 +63,19 @@ li.textContent = item.text; liContent.appendChild(li); }); - totalHight = document.body.scrollHeight - window.innerHeight; + let newsinfo = [ + { text: "示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例" }, + { text: "示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例" }, + { text: "示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例" }, + ]; + const pContent = document.querySelector('.newsinfo'); + + newsInfo.forEach(item => { + const p = document.createElement('p'); + p.textContent = item.text; + pContent.appendChild(p); + }); + let totalHight = document.body.scrollHeight - window.innerHeight; }); const Prostick = document.querySelector('.Prostick') window.addEventListener('scroll', function () {