Javascript模拟的DOS窗口代码实例(2)

2008-02-23 08:08:28来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


cmdWindow.ondeactivate = function (){ window.parent.CurrentCmdBlur(this); }
obj.appendChild(cmdWindow);
}

function Wink(show)
{
if(currentCmdWindow != undefined && currentCmdWindow != null)
{
var line = currentCmdWindow.getElementsByTagName("P")[currentCmdWindow.getElementsByTagName("P").length - 1];
if(show)
{
line.innerText = "_";
}
else
{
line.innerText = line.innerText.replace(/_$/, "");
}
}
setTimeout("Wink(" !show ")", 500);
}

function GetRandomNum(max)
{
return parseInt(Math.random() * max 1);
}

window.onload = function()
{
win.document.body.innerHTML = "<div id=\"Frame\" onselectstart=\"return false;\"></div>";
win.document.appendChild(win.document.createElement("STYLE"));
win.document.styleSheets[0].addRule("body", "padding: 0px; margin: 0px;");
win.document.styleSheets[0].addRule("#Frame", "width: 100%; height: 100%; background: #3A6EA5;");
win.document.styleSheets[0].addRule(".Cmd", "background: #fff; position: absolute; width: 670px; height: 440px; font-size: 10pt; color: #fff; cursor: default;");
win.document.styleSheets[0].addRule(".Title", "filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#6B79B8,endColorStr=#8C9ADB,GradientType=1); height: 24px; font-weight: bold;");
win.document.styleSheets[0].addRule(".Title span", "float: left; line-height: 20px;");
win.document.styleSheets[0].addRule(".Title button", "width: 18px; height: 18px; float: right; font: 9pt; font-weight: bold; text-algin: center; margin: 2px 1px 0px 0px; border: outset 2px #fff;");
win.document.styleSheets[0].addRule(".Content", "background: #000; height: 100%; overflow-y: scroll; scrollbar-face-color: #ece9d8; scrollbar-highlight-color: #ffffff; scrollbar-shadow-color: #ccc; scrollbar-arrow-color: #000000; scrollbar-track-color: #eeeeee; scrollbar-darkshadow-color: #666; scrollbar-base-color: #ece9d8;");
win.document.styleSheets[0].addRule(".Content p", "margin: 0px; line-height: 16px;");
win.document.styleSheets[0].addRule(".Content .Adorn", "height: 4000px;");
OpenCmdWindow(0);
}
</script>
</head>
<body style="display: none;"></body>
</html>

  具体效果如下: