- 積分
- 584
- 威望
- 584
- 金錢
- 308
- 最後登錄
- 2021-1-17
|
本帖最後由 mybpcity 於 2016-12-12 07:59 編輯
- <tbody>
- <tr align="center" class="altbg2">
- <TABLE width="100%">
- <tr align="center" class="altbg2">
- <TABLE width="100%" height="25" bordercolor="#00FF7F" border="1" cellspacing="0" cellpadding="0">
- <TR><TD>
- <div style="background-color:#D4EDFF; height:30px; line-height:25px; overflow:hidden; position:relative; width:100%;">
- <div id="divGlobalIndexScroll" style="position:absolute; left:10px; top:0px; width:960px; display:none;">
- <div><b>亚太股指</b>:香港恒生@hkHSI@ 台北加权@b_TWSE@ 日经225@b_NKY@ 韩国成份@b_KOSPI@ 澳交所普通股@b_AS30@</div>
- <div><b>欧洲股指</b>:英国富时@b_UKX@ 德国DAX@b_DAX@ 法国CAC40@b_CAC@ 俄罗斯MICEX@b_INDEXCF@ 欧洲Stoxx50@b_SX5E@</div>
- <div><b>美洲股指</b>:道琼斯@gb_dji@ 纳斯达克@gb_ixic@ 标普500@gb_inx@ 加拿大@b_SPTSX@ 巴西BOVESPA@b_IBOV@</div>
- <div><b>其他行情</b>:NYMEX原油@hf_CL@ CBOT黄金@hf_GC@ LME铜@hf_CAD@ 美元指数@DINI@ 道指期货@hf_DJS@</div>
- </div>
- <div style="position:absolute; left:5px; top:6px; width:50px;">
- <a href="#" id="arrowUp" style="background:url([img]http://i2.sinaimg.cn/cj/financewidget/image/arrowup.gif[/img]); display:block; float:left; height:15px; margin-right:3px; width:15px;"></a>
- <a href="#" id="arrowDown" style="background:url([img]http://i1.sinaimg.cn/cj/financewidget/image/arrowdown.gif[/img]); display:block; float:left; height:15px; width:15px;"></a>
- </div>
- </div>
- <script type="text/javascript">
- (new function () {
- this._elementGlobalIndexScroll = null;
- this._arrayList = [];
- this._stringHTMLTemplate = '';
- this._intTop = 0;
- this._intThreadScroll = -1;
- this._intThreadHQ = -1;
- this._intCount = 0;
- this._booleanOut = true;
-
- this._get = function (__stringId) {
- return document.getElementById(__stringId);
- };
- this._bind = function (__functionBind, __argumentsBind) {
- var __this = this;
- return function () {
- var __arguments = null;
- if (typeof __argumentsBind != "undefined") {
- for (var i = 0; i < arguments.length; i++) {
- __argumentsBind.push(arguments[i]);
- }
- __arguments = __argumentsBind;
- }
- else {
- __arguments = arguments;
- }
- return __functionBind.apply(__this, __arguments);
- };
- };
- this._load = function () {
- var __elementScript = document.createElement("script");
- __elementScript.type = "text/javascript";
- __elementScript.src = "http://hq.sinajs.cn/rn=" + (new Date()).getTime() + "&list=" + this._arrayList.join(",");
- __elementScript._functionCallback = this._bind(this._fill);
- __elementScript[document.all ? "onreadystatechange" : "onload"] = function () {
- if (document.all && this.readyState != "loaded" && this.readyState != "complete") {return;}
- this._functionCallback();
- this._functionCallback = null;
- this[document.all ? "onreadystatechange" : "onload"] = null;
- this.parentNode.removeChild(this);
- };
- this._elementGlobalIndexScroll.parentNode.appendChild(__elementScript);
- };
- this._fill = function () {
- if (this._elementGlobalIndexScroll.style.display == "none") {
- this._elementGlobalIndexScroll.style.display = "";
- }
- var __stringHTMLTemplate = this._stringHTMLTemplate;
- for (var i in this._arrayList) {
- var __stringKey = this._arrayList[i];
- var __arrayData = window["hq_str_" + __stringKey].split(",");
- var __arrayHQ = [];
- var __stringColor = '';
- var __stringFlag = "";
- switch (__stringKey.substr(0, 2)) {
- case "b_":
- __arrayHQ[0] = parseInt(__arrayData[1]);
- __arrayHQ[1] = (__arrayData[3] * 1).toFixed(2);
- if (__arrayData[3] * 1 > 0) {
- __stringColor = ' style="color:#008000;"';
- }
- else if (__arrayData[3] * 1 < 0) {
- __stringColor = ' style="color:#F00;"';
- }
- __stringFlag = __arrayHQ[1] * 1 > 0 ? "+" : "";
- break;
- case "hk":
- __arrayHQ[0] = parseInt(__arrayData[6]);
- __arrayHQ[1] = (__arrayData[8] * 1).toFixed(2);
- if (__arrayData[8] * 1 > 0) {
- __stringColor = ' style="color:#008000;"';
- }
- else if (__arrayData[8] * 1 < 0) {
- __stringColor = ' style="color:#F00;"';
- }
- __stringFlag = __arrayHQ[1] * 1 > 0 ? "+" : "";
- break;
- case "gb":
- __arrayHQ[0] = parseInt(__arrayData[1]);
- __arrayHQ[1] = (__arrayData[2] * 1).toFixed(2);
- if (__arrayData[2] * 1 > 0) {
- __stringColor = ' style="color:#008000;"';
- }
- else if (__arrayData[2] * 1 < 0) {
- __stringColor = ' style="color:#F00;"';
- }
- __stringFlag = __arrayHQ[2] * 1 > 0 ? "+" : "";
- break;
- case "hf":
- __arrayHQ[0] = (__arrayData[0] * 1).toFixed(2);
- __arrayHQ[1] = ((__arrayData[0] * 1 - __arrayData[7] * 1) / __arrayData[7] * 1 * 100).toFixed(2);
- if ((__arrayData[0] * 1 - __arrayData[7] * 1) > 0) {
- __stringColor = ' style="color:#008000;"';
- }
- else if ((__arrayData[0] * 1 - __arrayData[7] * 1) < 0) {
- __stringColor = ' style="color:#F00;"';
- }
- __stringFlag = (__arrayData[0] * 1 - __arrayData[7] * 1) * 1 > 0 ? "+" : "";
- break;
- default:
- if (__stringKey == "DINI" || __stringKey == "DJS") {
- __arrayHQ[0] = (__arrayData[8] * 1).toFixed(2);
- __arrayHQ[1] = ((__arrayData[8] * 1 - __arrayData[3] * 1) / __arrayData[3] * 1 * 100).toFixed(2);
- if ((__arrayData[8] * 1 - __arrayData[3] * 1) > 0) {
- __stringColor = ' style="color:#008000;"';
- }
- else if ((__arrayData[8] * 1 - __arrayData[3] * 1) < 0) {
- __stringColor = ' style="color:#F00;"';
- }
- __stringFlag = (__arrayData[8] * 1 - __arrayData[3] * 1) * 1 > 0 ? "+" : "";
- }
- break;
- }
- var __stringHQHTML = '<span' + __stringColor + '>' + __arrayHQ[0] + ' ' + __stringFlag + __arrayHQ[1] + '%</span>';
- __stringHTMLTemplate = __stringHTMLTemplate.replace(new RegExp("@" + __stringKey + "@", "g"), __stringHQHTML);
- }
- this._elementGlobalIndexScroll.innerHTML = __stringHTMLTemplate + __stringHTMLTemplate;
- };
- this._scroll = function () {
- if (this._booleanOut) {
- this._intCount++;
- if (this._intCount == 325) {
- this._intCount = 0;
- }
- if (this._intCount >= 300) {
- this._intTop = this._intTop == -100 ? -1 : this._intTop - 1;
- this._elementGlobalIndexScroll.style.top = this._intTop + "px";
- }
- }
- };
- this._eventMouseover = function () {
- this._booleanOut = false;
- };
- this._eventMouseout = function () {
- this._booleanOut = true;
- };
- this._scrollTo = function (__intScrollTo) {
- this._intTop += __intScrollTo;
- if (this._intTop > 0) {this._intTop -= 100;}
- if (this._intTop < -100) {this._intTop += 100;}
- this._elementGlobalIndexScroll.style.top = this._intTop + "px";
- return false;
- };
- this.boot = function (__stringTargetId, __arrayList) {
- this._arrayList = __arrayList;
- this._elementGlobalIndexScroll = this._get(__stringTargetId);
- this._stringHTMLTemplate = this._elementGlobalIndexScroll.innerHTML;
- this._load();
- this._intThreadHQ = setInterval(this._bind(this._load), 60 * 1000);
- this._intThreadScroll = setInterval(this._bind(this._scroll), 10);
- this._elementGlobalIndexScroll.parentNode.onmouseover = this._bind(this._eventMouseover);
- this._elementGlobalIndexScroll.parentNode.onmouseout = this._bind(this._eventMouseout);
- this._get("arrowUp").onclick = this._bind(this._scrollTo, [25]);
- this._get("arrowDown").onclick = this._bind(this._scrollTo, [-25]);
- };
- }).boot("divGlobalIndexScroll", ["b_AS30","b_NKY","b_TWSE","hkHSI","b_UKX","b_CAC","b_DAX","b_INDEXCF","gb_dji","gb_ixic","gb_inx","b_IBOV","b_KOSPI","b_SX5E","b_SPTSX","hf_GC","hf_CL","hf_CAD","DINI","hf_DJS"]);
- </script>
- </div></td></tr>
- </table>
複製代碼 |
|