forked from luofei2011/demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
duobei.html
333 lines (315 loc) · 13.3 KB
/
duobei.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CCAV今日直播</title>
<link rel="stylesheet" href="./css/doubei.css" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if IE 6]>
<link rel="stylesheet" href="./css/ie6.css" />
<![endif]-->
<script type="text/javascript" src="./js/data.js"></script>
</head>
<body>
<script type="text/javascript">
window.onload = function() {
var oInput = $('search-text'), // 搜索框
totop = $('totop'), // 回顶部
header = $('header'), // header元素
other_plat = $('other-plat'), // 第三方平台登录
oMain = getElementByClassName('div.main'), // 事件监听器
// 42px 为回顶部按钮自身的宽度
winWidth = (document.body.clientWidth - 960) / 2 - 42;
// 兼容placeholder
placeholder(oInput);
// 固定回顶部按钮的位置
totop.style.right = winWidth + 'px';
// 监听滚动事件并进行处理
window.onscroll = function() {
var scrollTop = document.documentElement.scrollTop || // ie
document.body.scrollTop;
if ( scrollTop > 40 ) {
totop.style.display = 'block';
other_plat.style.display = 'block';
header.style.display = 'none';
} else {
totop.style.display = 'none';
other_plat.style.display = 'none';
header.style.display = 'block';
}
}
// 给回顶部按钮绑定事件
totop.onclick = function() {
window.scroll(0, 0);
}
// 使用父节点main做所有a.thumb的事件代理源
oMain[0].onclick = function(e) {
var e = window.event || e; // ie and w3c DOM
var oTarget = e.srcElement ? e.srcElement : e.target,
className = oTarget.className, prev;
prev = oTarget.previousSibling;
if ( className === 'thumb_non_active' ) {
oTarget.className = 'thumb_active';
prev.innerHTML = prev.innerHTML * 1 + 1; // * 1转换成int型
} else if ( className === 'thumb_active' ) {
oTarget.className = 'thumb_non_active';
prev.innerHTML = prev.innerHTML * 1 - 1;
}
}
}
</script>
<div id="wrapper">
<div id="header">
<div class="grid-960">
<p class="headlink">
<a href="http://duobei.com">首页</a>
<a href="#" class="active">随便逛逛</a>
<a href="#">继续随便逛逛</a>
</p>
<ul class="headmenu">
<li>
<a href="#">注册</a>
</li>
<li>
<a href="#">登录</a>
</li>
<li>
<div class="form-search">
<form action="" method="post">
<input name ="search-text" id="search-text" type="text" placeholder="搜索你感兴趣的课程">
<input type="submit" class="form-submit">
</form>
</div>
</li>
</ul>
</div>
</div>
<div id="content">
<div class="today-live">
<div class="content-title grid-960">
<h2>CCAV今日直播</h2>
<b class="content-title-icon"></b>
</div>
<div class="live-wrap">
<div class="live-item grid-960">
<ul>
<script type="text/javascript">
;(function() {
var today_live = data['today_live'],
len = today_live.length, i = 0,
str = "";
for ( ; i < len; ) {
if ( i == len - 1 ) {
str += '<li class="non-margin-right">';
} else {
str += '<li>';
}
str += '<div class="one_video"><a href="#" class="video-bak">' +
'<img src="' + today_live[i].url + '"></a>' +
'<div class="detail-msg"><p' +
' class="item-title"><a href="#">' +
today_live[i].title + '</a></p>' +
'<p class="item-content">' + today_live[i].content + '</p>' +
'<div class="author-msg">' +
'<a href="#" class="author-photo"><img src="' +
today_live[i].author_photo + '"></a>' +
'<a href="#" class="author-name">' +
today_live[i].author_name + '</a>' +
'<span class="pub-time">' + today_live[i].pub_time +
'</span></div></div>';
if ( today_live[i].is_live ) {
str += '<a href="#" class="live-icon">直播</a>';
}
str += '</div></li>';
i += 1;
}
document.write(str);
})();
</script>
</ul>
</div>
</div>
</div>
<div class="grid-960">
<!--互联网科技创业-->
<div class="main">
<div class="content-title">
<h2>互联网·科技·创业</h2>
</div>
<ul>
<script type="text/javascript">
;(function() {
var internet = data['internet'],
len = internet.length, i = 0,
str = "";
for ( ; i < len; ) {
str += '<li class="small-item"><div class="one_video">' +
'<a href="#" class="video-bak"><img src="' +
internet[i].url + '"></a>' +
'<div class="detail-msg"><p class="small-item-title">' +
'<a href="#">' + internet[i].title + '</a></p>' +
'<div class="author-msg">' +
'<a href="#" class="author-photo"><img src="' +
internet[i].author_photo + '"></a>' +
'<a href="#" class="author-name">' +
internet[i].author_name + '</a>' +
'<span class="fllow_num">' + internet[i].fllow_num + '</span>' +
'<a href="javascript:void(0);" class="thumb_non_active">' +
'</a></div></div>';
if ( internet[i].is_live ) {
str += '<a href="#" class="live-icon">直播</a>';
}
str += '</div></li>';
i += 1;
}
document.write(str);
})();
</script>
</ul>
<!--互联网科技创业结束-->
<!--出国等相关视频信息-->
<div class="content-title">
<h2>出国留学 托福·SAT·雅思</h2>
</div>
<ul>
<script type="text/javascript">
;(function() {
var abroad = data['abroad'],
len = abroad.length, i = 0,
str = "";
for ( ; i < len; ) {
str += '<li class="small-item"><div>' +
'<a href="#" class="video-bak"><img src="' +
abroad[i].url + '"></a>' +
'<div class="detail-msg"><p class="small-item-title">' +
'<a href="#">' + abroad[i].title + '</a></p>' +
'<div class="author-msg">' +
'<a href="#" class="author-photo"><img src="' +
abroad[i].author_photo + '"></a>' +
'<a href="#" class="author-name">' +
abroad[i].author_name + '</a>' +
'<span class="fllow_num">' + abroad[i].fllow_num + '</span>' +
'<a href="javascript:void(0);" class="thumb_active">' +
'</a></div></div></div></li>';
i += 1;
}
document.write(str);
})();
</script>
</ul>
<!--出国等相关视频信息结束-->
</div>
<div class="slide">
<div class="game-video">
<p>牛人的dota视频!!!</p>
<a href="#">
<img src="./img/bak/duobei_90.png" alt="" />
</a>
<span class="gray-arrow"></span>
</div>
<p class="play-dota">你游戏么? dota排行榜</p>
<div class="game-rank">
<script type="text/javascript">
;(function() {
var game_rank = data['game_rank'],
len = game_rank.length, i = 0,
str = "";
for ( ; i < len; ) {
str += '<div class="person-list">' +
'<a href="#" class="author-photo"><img src="' +
game_rank[i].person_photo + '"></a>' +
'<div class="person-msg clearfix"><a href="#">' +
game_rank[i].person_name + '</a>' +
'<div>' + game_rank[i].description + '</div></div></div>';
i += 1;
}
document.write(str);
})();
</script>
</div>
</div>
</div>
</div>
<span>
<a id="totop" href="javascript:void(0);"></a>
</span>
<div id="other-plat">
<span>优秀的你, 一定想发现, 分享更多干货知识</span>
<span class="write-arrow"></span>
<a href="" class="weibo-login">新浪微博登录</a>
<a href="" class="renren-login">人人帐号登录</a>
</div>
<!--铺满一屏-->
<div id="footer-push"></div>
</div>
<script type="text/javascript" src="./js/doubei.js"></script>
<div id="footer" class="grid-960">
<ul>
<li>
<div class="duobei_logo"></div>
<p>找课程, 上多贝</p>
</li>
<li>
<p class="footer-item-title">我是老师</p>
<p>
<a href="#">发布公开课</a>
</p>
<p>
<a href="#">教室常见方式</a>
</p>
<p>
<a href="#">收费方式</a>
</p>
<p>
<a href="#">如何嵌入多贝网络教室</a>
</p>
<p>
<a href="#">如何实现屏幕共享</a>
</p>
</li>
<li>
<p class="footer-item-title">我是学生</p>
<p>
<a href="#">参加直播课</a>
</p>
<p>
<a href="#">课程表</a>
</p>
</li>
<li>
<p class="footer-item-title">关于多贝</p>
<p>
<a href="#">和我们一起工作</a>
</p>
<p>
<a href="#">意见反馈</a>
</p>
<p>
<a href="#">联系我们</a>
</p>
<p>
<a href="#">友情链接</a>
</p>
</li>
<li>
<p class="footer-item-title">关注我们</p>
<p>
<a href="#" class="weibo-icon">新浪微博</a>
</p>
<p>
<a href="#" class="tx-icon">腾讯微博</a>
</p>
<p>
<a href="#" class="rr-icon">人人主页</a>
</p>
</li>
</ul>
<div class="footer-company-info">
<span>Copyright © 2013 duobei.com | </span>
<a href="#">服务条款</a> |
<a href="#">京ICP证110831</a> |
<span>京网安备11010802009</span>
</div>
</div>
</body>
</html>