📄 带开关的时钟.txt
字号:
带开关的时钟效果
<script language="JavaScript">var enabled = 0;
function TOfunc() {
TO = window.setTimeout( "TOfunc()", 1000 );
var today = new Date();
document.clock.disp.value = today.toLocaleString();}
</script>
<form name="clock">
<input type="text" name="disp" value="" size=20 onFocus="this.blur()" >
<br><input type="radio" name="rad" value="OFF" checked onClick="
if( enabled==1 )
{document.clock.disp.value='';clearTimeout( TO );enabled = 0;}"> 关
<input type="radio" name="rad" value="on"onClick="if( enabled == 0 ) {var TO = setTimeout( 'TOfunc()', 1000 );enabled = 1;}"> 开
</form>
关 开
旋转的文本
第一步:把下面的脚本插入<head>与</head>之间:
<STYLE>.fly {
POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 2
}
.logo {
LEFT: 231px; POSITION: absolute; TOP: 130px; VISIBILITY: visible; Z-INDEX: 1
}
.desc {
COLOR: #006600; FONT-FAMILY: 宋体; LEFT: 235px; POSITION: absolute; TEXT-ALIGN: center; TOP: 355px; VISIBILITY: hidden; WIDTH: 100px
}
a:active { font-family: "宋体"; font-size: 9pt; color: #006600; text-decoration: none}
a:hover { font-family: "宋体"; font-size: 9pt; color: #00FF00; text-decoration: underline}
a:link { font-family: "宋体"; font-size: 9pt; color: #006600; text-decoration: none}
a:visited { font-family: "宋体"; font-size: 9pt; color: #006600; text-decoration: none}
body { font-size: 9pt; color: #006600}
</STYLE>
<SCRIPT language=JavaScript>
function showObject(object) {
object.visibility = VISIBLE;
}
function hideObject(object) {
object.visibility = HIDDEN;
}
function slideLogo(from, to) {
if (from < to) {
company.top = (from += 10);
setTimeout('slideLogo(' + from + ',' + to + ')', 75);
}
else initObjects();
}
function rotateObjects() {
for (var i = 0; i < pos.length; i++) {
pos += inc; objects.visibility = 'visible';
objects.left = (r * Math.cos(pos)) + xoff
objects.top = (r * Math.sin(pos)) + yoff;
}
rotateTimer = setTimeout("rotateObjects()", 75);
}
function initObjects() {
objects = new Array(fly1, fly2, fly3, fly4, fly5);
pos = new Array();
pos[0] = 0;
for (var i = 1; i < objects.length; i++) {
pos = parseFloat(pos[i - 1] + ((2 * pi) / objects.length));
}
rotateObjects();
}
var objects;
var pos;
var r = 148; // 旋转的半径
var xoff = 260; // 旋转的X座标
var yoff = 150; // Y座标
var pi = Math.PI; //
var inc = pi / 180;
var objects;
var pos;
</SCRIPT>
<script language="JavaScript1.2">
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50);
showObject(desc6);
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=70;
hideObject(desc6);
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=3
else if (window.highlighting)
clearInterval(highlighting)
}
</script>
第二步:把下面的脚本插入<body>与</body>之间:
<div class=fly id=fly1><a href="http://oke.yeah.net" onmouseout=hideObject(desc1) onmouseover=showObject(desc1) target="_blank" >蓝色沙漠</a><br> file://以下为旋转的文本
</div>
<DIV class=fly id=fly2><a href="#" onmouseout=hideObject(desc2) onmouseover=showObject(desc2)>链接2</a><BR>
</DIV>
<DIV class=fly id=fly3><a href="#"onmouseout=hideObject(desc3) onmouseover=showObject(desc3)>链接3</a><BR>
</DIV>
<DIV class=fly id=fly4><a href="#" onmouseout=hideObject(desc4) onmouseover=showObject(desc4)>链接4</a><BR>
</DIV>
<DIV class=fly id=fly5><a href="#" onmouseout=hideObject(desc5) onmouseover=showObject(desc5)>链接5</a><BR>
</DIV>
<DIV class=logo id=company style="z-index: 1">
<p>蓝色沙漠---技术中心</p>
<p>DHTML之旋转的文本</p>
<p>这里也可以是图象!</p>
</DIV>
<DIV class=desc id=desc1>蓝色沙漠</DIV> file://以下改成你的链接说明
<DIV class=desc id=desc2>链接说明2</DIV>
<DIV class=desc id=desc3>链接说明3</DIV>
<DIV class=desc id=desc4>链接说明4</DIV>
<DIV class=desc id=desc5>链接说明5</DIV>
<SCRIPT language=JavaScript>
var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var HIDDEN = (isNS) ? 'hide' : 'hidden';
var VISIBLE = (isNS) ? 'show' : 'visible';
var fly1 = (isNS) ? document.fly1 : document.all.fly1.style;
var fly2 = (isNS) ? document.fly2 : document.all.fly2.style;
var fly3 = (isNS) ? document.fly3 : document.all.fly3.style;
var fly4 = (isNS) ? document.fly4 : document.all.fly4.style;
var fly5 = (isNS) ? document.fly5 : document.all.fly5.style;
var company = (isNS) ? document.company : document.all.company.style;
var desc1 = (isNS) ? document.desc1 : document.all.desc1.style;
var desc2 = (isNS) ? document.desc2 : document.all.desc2.style;
var desc3 = (isNS) ? document.desc3 : document.all.desc3.style;
var desc4 = (isNS) ? document.desc4 : document.all.desc4.style;
var desc5 = (isNS) ? document.desc5 : document.all.desc5.style;
slideLogo(-200, 130); file://下降开始与结束的位置
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -