-
Notifications
You must be signed in to change notification settings - Fork 0
/
news.html
136 lines (136 loc) · 4.07 KB
/
news.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/public.css">
<style>
html,body{
width:100%;
}
.head ul li:nth-child(2){
border-bottom:6px solid #866961;
}
.head ul li:nth-child(2){
color:#866961;
}
.banner{
width:100%;
height:400px;
background:url("images/newsban.png");
}
.content .con{
display:flex;
justify-content:space-between;
font-family:微软雅黑;
margin:37px 59px 0px 59px;
padding-bottom:6px;
border-bottom:1px solid #f2f2f2;
}
.content .con .cof{
width:328px;
display:flex;
justify-content:space-between;
}
.content .con .cof div h3{
font-size:16px;
color:#333;
}
.content .con .cof h3 span{
display:inline-block;
height:10px;
border-left:2px solid #866961;
margin-right:6px;
}
.content .con .cof div h4{
font-size:12px;
color:#999;
}
.content .con .add{
font-size:14px;
color:#333;
padding-top:20px;
}
.content .con .add span{
color:#999;
}
.content .news{
margin:0px 59px 52px 59px;
font-family:微软雅黑;
}
.content .news h1{
font-size:20px;
color:#333;
line-height:92px;
text-align:center;
}
.content .news img{
margin:0 auto;
}
.content .news h2{
font-size:16px;
color:#333;
line-height:34px;
text-indent:2em;
}
</style>
</head>
<body>
<div class="head main">
<img src="images/logo.png">
<ul>
<li><a href="index.html">首页</a></li>
<li><a href="about.html">关于我们</a></li>
<li><a href="product.html">产品介绍</a></li>
<li><a href="team.html">我们团队</a></li>
<li><a href="contact.html">联系我们</a></li>
</ul>
</div>
<div class="banner"></div>
<div class="content main">
<div class="con">
<div class="cof">
<div>
<h3><span></span>新闻中心</h3>
<h4>News Center</h4>
</div>
</div>
<div class="add">当前位置><span>首页>关于我们></span>新闻中心</div>
</div>
<div class="news"></div>
</div>
<div class="footer">
<div class="foot main">
<p>COPYRIGHT © 重庆DUZU有限公司 | DUZU备案号 33010602001878 号 版权所有:重庆戈登有限公司</p>
<img src="images/logo.png">
</div>
</div>
<script>
var news=document.querySelector(".content .news");
var xhr=new XMLHttpRequest();
xhr.open("GET","./about.php?type=2&index1="+sessionStorage["index1"]);
xhr.send(null);
xhr.onreadystatechange=function (){
if(xhr.readyState==4 && xhr.status==200){
var arr=JSON.parse(xhr.responseText);
var frag=document.createDocumentFragment();
var h1=document.createElement("h1");
h1.innerHTML=arr.title;
frag.appendChild(h1);
var img=new Image();
img.src=arr.img;
frag.appendChild(img);
var con=arr.con.split("\n");
for(var i=0;i<con.length;i++){
var h2=document.createElement("h2");
h2.innerHTML=con[i];
frag.appendChild(h2);
}
news.appendChild(frag);
}
}
</script>
</body>
</html>