飄雪效果:
<script language="JavaScript">
N = 200;
Y = new Array();
X = new Array();
S = new Array();
A = new Array();
B = new Array();
M = new Array();
V = (document.layers)?1:0;
iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;
iW=(document.layers)?window.innerWidth:window.document.body.clientWidth;
for (i=0; i < N; i++){
Y=Math.round(Math.random()*iH);
X=Math.round(Math.random()*iW);
S=Math.round(Math.random()*5+2);
A=0;
B=Math.random()*0.1+0.1;
M=Math.round(Math.random()*1+1);
}if (V){for (i = 0; i < N; i++)
{document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#fffff0' CLIP='0,0,"+M+","+M+"'></LAYER>")}
}else{document.write('<div style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">');
for (i = 0; i < N; i++)
{document.write('<div id="si" style="position:absolute;top:0;left:0;width:'+M+';height:'+M+';background:#fffff0;font-size:'+M+'"></div>')}
document.write('</div></div>');}
function snow(){var H=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var W=(document.layers)?window.innerWidth:window.document.body.clientWidth;
var T=(document.layers)?window.pageYOffset:document.body.scrollTop;
var L=(document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < N; i++){sy=S*Math.sin(90*Math.PI/180);
sx=S*Math.cos(A);
Y+=sy;
X+=sx;
if (Y > H){Y=-10;
X=Math.round(Math.random()*W);
M=Math.round(Math.random()*1+1);
S=Math.round(Math.random()*5+2);}
if (V){document.layers['sn'+i].left=X;document.layers['sn'+i].top=Y+T}
else{si.style.pixelLeft=X;si.style.pixelTop=Y+T}
A+=B;}setTimeout('snow()',10);}window.onLoad=snow()
</script>
定時轉換背景圖:
<SCRIPT Language="JavaScript">
var backgroundimage=new Array("圖片網址","圖片網址","圖片網址","圖片網址");
var swapspeed=10
var timer
var imgpreload=new Array()
if (document.all) {
for (i=0;i<=backgroundimage.length-1;i++) {
imgpreload=new Image()
imgpreload.src=backgroundimage
}}var i_backgroundimage=0
swapspeed=swapspeed*1000
function swapimages() {if (document.all) {
window.status=i_backgroundimage
document.body.background=backgroundimage[i_backgroundimage]
i_backgroundimage++
if (i_backgroundimage>=backgroundimage.length) {i_backgroundimage=0}timer=setTimeout("swapimages()",swapspeed)
}}window.onload=swapimages
</SCRIPT>
板面負片:
<style>
body{Filter:Invert}
</style>
板面灰階:
<style>
body{filter:gray}
</style>
跑馬燈訊息公告:
<style type="text/css">
.msgfont{width:360px; background-color: #888888; color: ffffff; font-family: 新細明體; font-size: 13px; text-align:left;}
</style>
<script language=JavaScript1.2>
<!--
var line=new Array()
line[1]="【雄之網頁】給所有人 的話: 本站提供留言板語法"
line[2]="【別問我是誰】給大家 的話: 本站提供教學及素材"
line[3]="別問我是誰_雄之網頁: 本站提供少量程式下載"
line[4]="雄之網頁_別問我是誰: 本站開網日期為:2002年 5月 13日"
line[5]="【別問我是誰】給大家 的話:本站永久網址為 http://lthung.org"
var longestmessage=1
for (i=1;i<line.length;i++){
if (line.length>line[longestmessage].length)
longestmessage=i}
var tscroller_width=line[longestmessage].length*2
lines=line.length-1
if (document.all||document.getElementById){
document.write('<span id="banner" class="msgfont"></span>')
}
temp=''
nextchar=-1;
nextline=1;
function animate(){
if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
nextline++;
nextchar=-1;
banner.innerHTML=temp;
temp='';
setTimeout('nextstep()',3000)}
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
nextline=1;
nextchar=-1;
banner.innerHTML=temp;
temp='';
setTimeout('nextstep()',3000)}
else{nextstep()}}
function nextstep(){
nextchar++;
temp+=line[nextline].charAt(nextchar);
banner.innerHTML=temp
setTimeout("animate()",100)}
if (document.all||document.getElementById)
window.onload=animate
// -->
</script>
走字語法:
<SCRIPT Language="JavaScript">
if(navigator.appVersion.charAt(0)>=4 && (navigator.appVersion).indexOf("MSIE")!=-1) isIE4 = true;
else isIE4 = false;
function textAnima_color2(id,n) {
el = document.all.item(id,n);
charColor = el.getAttribute("SET_COLOR");
cur = el.getAttribute("CURRENT_CHAR");
if(cur=="") cur = 0;
getHTML= el.getAttribute("SET_TEXT");
if(getHTML == "") {
getHTML = el.innerText;
el.setAttribute("SET_TEXT",getHTML);}
bef_t = getHTML.substring(0,cur); ;
aft_t = getHTML.substring(eval(cur)+1,getHTML.length);
cur_t = getHTML.substr(cur,1);
cur_t = cur_t.fontcolor(charColor);
el.innerHTML = bef_t + cur_t + aft_t;cur++;
if(cur > getHTML.length) cur=0;
el.setAttribute("CURRENT_CHAR",cur);
getT = el.getAttribute("SET_TIME");
if(getT=="") getT = 100;
setTimeout("textAnima_color2('"+id+"',"+n+")",eval(getT));}
if(isIE4) {window.onload = init;}
function init() {
id = "ANIMA_TEXT_COLOR2";
len = document.all.item(id).length;
if(!len) len=1;
for(var i=0;i<len;i++) {
textAnima_color2(id,i);}}
</SCRIPT>
<span style="FONT-SIZE:20pt;COLOR:blue;FONT-FAMILY:標楷體;Times New Roman" id="ANIMA_TEXT_COLOR2" SET_COLOR="red" SET_TIME="80" CURRENT_CHAR SET_TEXT>歡迎光臨*雄之網頁</span>
單色邊框:
<style>
body{
border-left: 10px dotted pink;
border-right: 10px dotted pink;
border-top: 10px dotted pink;
border-bottom: 10px dotted pink;
}</style>
<script language=javascript>
var rate = 100; // Increase amount(The degree of the transmutation)
var obj; // The object which event occured in
var act = 0; // Flag during the action
var elmH = 0; // Hue
var elmS = 128; // Saturation
var elmV = 255; // Value
var clrOrg; // A color before the change
var TimerID; // Timer ID
si=setInterval;
if (navigator.appName.indexOf("Microsoft",0) != -1 && parseInt(navigator.appVersion) >= 4) {
Browser = true;
} else {
Browser = false;
}
if (Browser) {
document.onmouseover = doRainbowAnchor;
document.onmouseout = stopRainbowAnchor;
}
function doRainbow()
{
if (Browser && act != 1) {
act = 1;
obj = event.srcElement;
clrOrg = obj.style.color;
TimerID = si("ChangeColor()",100);
}
}
function stopRainbow()
{
if (Browser && act != 0) {
obj.style.color = clrOrg;
clearInterval(TimerID);
act = 0;
}
}
function doRainbowAnchor()
{
if (Browser && act != 1) {
obj = event.srcElement;
while (obj.tagName != 'A' && obj.tagName != 'BODY') {
obj = obj.parentElement;
if (obj.tagName == 'A' || obj.tagName == 'BODY')
break;
}
if (obj.tagName == 'A' && obj.href != '') {
act = 1;
clrOrg = obj.style.color;
TimerID = si("ChangeColor()",100);
}
}
}
http://document.write.blogringfunction stopRainbowAnchor()
{
if (Browser && act != 0) {
if (obj.tagName == 'A') {
obj.style.color = clrOrg;
clearInterval(TimerID);
act = 0;
}
}
}
function ChangeColor()
{
obj.style.color = makeColor();
}
function makeColor()
{
// HSVtoRGB
if (elmS == 0) {
elmR = elmV; elmG = elmV; elmB = elmV;
}
else {
t1 = elmV;
t2 = (255 - elmS) * elmV / 255;
t3 = elmH % 60;
t3 = (t1 - t2) * t3 / 60;
if (elmH < 60) {
elmR = t1; elmB = t2; elmG = t2 + t3;
}
else if (elmH < 120) {
elmG = t1; elmB = t2; elmR = t1 - t3;
}
else if (elmH < 180) {
elmG = t1; elmR = t2; elmB = t2 + t3;
}
else if (elmH < 240) {
elmB = t1; elmR = t2; elmG = t1 - t3;
}
else if (elmH < 300) {
elmB = t1; elmG = t2; elmR = t2 + t3;
}
else if (elmH < 360) {
elmR = t1; elmG = t2; elmB = t1 - t3;
}
else {
elmR = 0; elmG = 0; elmB = 0;
}
}
http://document.write.blogringelmR = Math.floor(elmR);
elmG = Math.floor(elmG);
elmB = Math.floor(elmB);
clrRGB = '#' + elmR.toString(16) + elmG.toString(16) + elmB.toString(16);
elmH = elmH + rate;
if (elmH >= 360)
elmH = 0;
return clrRGB;
}
</script>