You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
4.1 KiB

3 weeks ago
<!DOCTYPE html>
<html lang="zh">
3 weeks ago
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
3 weeks ago
<title>web新闻网站</title>
3 weeks ago
<link rel="stylesheet" href="css/index.css">
3 weeks ago
<link rel="stylesheet" href="css/common.css">
3 weeks ago
</head>
3 weeks ago
3 weeks ago
<body>
<div class="Progress">
<div class="Prostick"></div>
</div>
<div class="navbar">
<div class="navinit">
<div class="logo">web新闻网站</div>
<div class="navbtnpart">
3 weeks ago
<div class="navbtn DStyle"><a href="index.html">首页</a></div>
<div class="navbtn DStyle"><a href="newsclass.html">新闻分类</a></div>
<div class="navbtn DStyle"><a href="foucsreport.html">专题报道</a></div>
<div class="navbtn DStyle"><a href="newsinfo.html">新闻资讯</a></div>
<div class="navbtn DStyle"><a href="#">互动交流</a></div>
3 weeks ago
</div>
</div>
</div>
<div class="mainbody">
<div class="banner">
3 weeks ago
<img src="">
3 weeks ago
</div>
3 weeks ago
<div class="dots-container"></div>
3 weeks ago
<div class="newszy">
<h3>新闻的作用</h3>
<ul>
</ul>
</div>
<div class="newsinfo">
<h3>新闻的定义</h3>
</div>
</div>
<div class="footer">web新闻网站</div>
3 weeks ago
<script>
let totalHight;
let Prostick;
document.addEventListener("DOMContentLoaded", function () {
let imgs = [];
const carouselImages = document.querySelector('.banner img');
const dotsContainer = document.querySelector('.dots-container');
let currentIndex = 0;
let newszyLis = [
3 weeks ago
{ text: "1.消除受众的不确定性。新闻通过报道新发生的事件和情况,帮助受众了解世界的最新变化。" },
{ text: "2.新闻能够反映社会现象和问题,影响和引导公众的思想和行为,实现社会舆论的监督引导。" },
{ text: "3.新闻报道涉及广泛的科学技术和社会生活领域,有助于人们获取新知识和新发现教育普及。" },
{ text: "4.新闻媒介还传播各种趣味性内容,如奇闻异事、风土人情等,在紧张工作得到娱乐和享受。" },
3 weeks ago
];
const liContent = document.querySelector('.newszy ul');
newszyLis.forEach(item => {
const li = document.createElement('li');
li.textContent = item.text;
liContent.appendChild(li);
});
let newsinfo = [
3 weeks ago
{ text: "“新闻,也叫消息、资讯,是通过报纸、电台、广播、电视台等媒体途径所传播信息的一种称谓。是记录社会、传播信息、反映时代的一种文体。新闻概念有广义与狭义之分,就其广义而言,除了发表于报刊、广播、互联网、电视上的评论与专文外的常用文本都属于新闻之列,包括消息、通讯、特写、速写(有的将速写纳入特写之列)等等,狭义的新闻则专指消息,消息是用概括的叙述方式,比较简明扼要的文字,迅速及时地报道国内外新近发生的、有价值的事实,让别人了解”。" },
3 weeks ago
];
const pContent = document.querySelector('.newsinfo');
newsinfo.forEach(item => {
const p = document.createElement('p');
p.textContent = item.text;
pContent.appendChild(p);
});
Prostick = document.querySelector('.Prostick');
3 weeks ago
totalHight = document.documentElement.scrollHeight - window.innerHeight;
3 weeks ago
});
window.addEventListener('scroll', function () {
if (totalHight && Prostick) {
let pro = (window.pageYOffset / totalHight) * 100;
Prostick.style.width = pro + '%';
}
});
3 weeks ago
</script>
</body>
</html>