-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathindex.html
62 lines (52 loc) · 2.04 KB
/
index.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
---
layout: main
title: 投资决策参考
---
<script>
//去除关注日期已经超过了180天的股票数据(默认全部显示)
var hqArr = new Array();
for(var i = 0; i < allHqArr.length; i++) {
//if(Math.round((new Date().getTime() - newDate(allHqArr[i][2]).getTime()) / 60 / 60 / 24 / 1000) + 1 <= 180) {
hqArr[i] = allHqArr[i];
//}
}
emptyIndexMake("index", indexArr);
emptyTableMake("stock", hqArr);
var stockUrl = urlMake(indexArr, hqArr); //urlMake可以接受若干个参数,内部实现使用arguments来收集参数
// 提供jsonp服务的url地址(不管是什么类型的地址,最终生成的返回值都是一段javascript代码)
doJsonp(stockUrl, stockArrayMake, 20000);
var nowTime = new Date();
if(nowTime.getHours() >= 9 && nowTime.getHours() <= 15) {
setInterval("doJsonp(stockUrl, stockArrayMake, 20000)", "5000");
}
//当鼠标移入表格行中时,改变颜色
function changeBlueColor(){
this.bgColor = "#E6F3FC" ;
}
function changeWhiteColor(){
this.bgColor = "white" ;
}
window.onload = function() {
var stockTable = document.getElementById("stockTable");
for(var x = 0; x < stockTable.rows.length; x++) {
stockTable.rows[x].addEventListener("mousemove", changeBlueColor, false);
stockTable.rows[x].addEventListener("mouseout", changeWhiteColor, false);
}
var historyTable = document.getElementById("historyTable");
for(var x = 0; x < historyTable.rows.length; x++) {
historyTable.rows[x].addEventListener("mousemove", changeBlueColor, false);
historyTable.rows[x].addEventListener("mouseout", changeWhiteColor, false);
}
}
</script>
<div class="morestock">
<button type="button" id="xygp">» 点击显示或隐藏更多股票 «</button>
</div>
<br />
<script>
historyTableMake("history", historyArr);
</script>
<div class="morestock">
<button type="button" id="lsgz">» 点击显示或隐藏更多股票 «</button>
</div>
<br/>