楼主的代码…
我有强迫症。- <HTA:APPLICATION ID="screen"
- APPLICATIONNAME="myApp1"
- contextMenu ="no"
- BORDER="none"
- innerBorder="no"
- SHOWINTASKBAR="yes"
- SINGLEINSTANCE="yes"
- SYSMENU="no"
- VERSION="1.0"
- WINDOWSTATE="maximize"
- ICON="taskmgr.exe"
- />
-
- <html lang="cn">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script language="JavaScript" type="text/javascript">
- function changeFontSize() {
- var w = document.body.clientWidth;
- var h = document.body.clientHeight;
- var size = w/3; size2 = w/9;
- if (w > 2000) {
- size = w/3;
- } else {
- size = w/3;
- }
- document.getElementById("curtime").style.fontSize = "" + size + "px";
- document.getElementById("cursec").style.fontSize = "" + size2 + "px";
- document.getElementById("curdate").style.fontSize = "" + size2 + "px";
- document.getElementById("curweek").style.fontSize = "" + size2 + "px";
- }
-
- function SetTimeText() {
- var dt1=new Date();
- document.getElementById("curtime").innerHTML = dt1.getHours() + ":" + ("00" + dt1.getMinutes()).slice(-2);
- document.getElementById("cursec").innerHTML = ("00" + dt1.getSeconds()).slice(-2);
- document.getElementById("curdate").innerHTML= dt1.getMonth() + "-" + dt1.getDate();
- document.getElementById("curweek").innerHTML = "周" + "日一二三四五六".substr(dt1.getDay(), 1);
- }
-
- window.onload = function(){
- SetTimeText();
- changeFontSize();
- setInterval(SetTimeText, 500);
- setInterval(changeFontSize, 1000);
- };
-
- function closeWindow() {
- try {
- var Shell = new ActiveXObject("Shell.Application");
- Shell = null;
- window.close();
- } catch(e) {}
- }
- </script>
- <style type="text/css">
- strong {display: inline}
- </style>
- </head>
- <body bgcolor="#000000" bordercolor="#000000" scroll="no" onclick="closeWindow()" onkeyup="closeWindow()">
- <table style="width:100%; height:100%; text-align:center">
- <tr>
- <td>
- <strong id=curtime style="font-size:400px;color:#ffffff;font-family:黑体" /></strong>
- <strong id=cursec style="font-size:50px;color:#ffffff;margin-left: 8px;"/></strong><br/>
- <strong id=curdate style="font-size:50px;color:#ffffff;font-family:黑体;margin-left: 50px;" /></strong>
- <strong id=curweek style="font-size:50px;color:#ffffff;font-family:黑体;margin-left: 50px;" /></strong>
- </td>
- </tr>
- </table>
- </body>
- </html>
复制代码
|