- 這篇文章限定好友觀看。
若您是好友,登入後即可閱讀。
目前分類:網頁語法特效~背景圖 (28)
- Jun 22 Sun 2008 11:15
化妝品選購七大技巧
- Jun 07 Sat 2008 17:53
自動替換背景
語法展示:: http://home.graffiti.net/wdfddnjkkl
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
var backgroundimage=new Array("01.gif","02.gif","03.gif","04.gif","05.gif")
var swapspeed=2
var timer
var imgpreload=new Array()
if (document.all) {
for (i=0;i<=backgroundimage.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=backgroundimage[i]
}
}
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>
在 var backgroundimage=new Array("01.gif","02.gif","03.gif","04.gif","05.gif") 中修改圖檔的名稱及路徑 |
在 var swapspeed=2 中修改變換的時間 |
- Jun 07 Sat 2008 17:53
自動替換背景
語法展示:: http://home.graffiti.net/wdfddnjkkl
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
var backgroundimage=new Array("01.gif","02.gif","03.gif","04.gif","05.gif")
var swapspeed=2
var timer
var imgpreload=new Array()
if (document.all) {
for (i=0;i<=backgroundimage.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=backgroundimage[i]
}
}
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>
在 var backgroundimage=new Array("01.gif","02.gif","03.gif","04.gif","05.gif") 中修改圖檔的名稱及路徑 |
在 var swapspeed=2 中修改變換的時間 |
- Jun 07 Sat 2008 17:53
星空背景
語法展示:: http://home.graffiti.net/jnnhgfxhdffd/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
cOlOuRs=new Array("abbbff","ffffee","ffff7a","dffffd","ffaaa0","ffddd0")
S_amount = 30;
L_amount = 10;
S_Ypos = new Array();
S_Xpos = new Array();
L_Ypos = new Array();
L_Xpos = new Array();
S_speed= new Array();
L_speed= new Array();
if (document.all)
{
for (i = 0; i < S_amount; i++)
{
S_Ypos[i] = Math.round(Math.random()*document.body.offsetHeight);
S_Xpos[i] = Math.round(Math.random()*document.body.offsetWidth);
}
for (i = 0; i < L_amount; i++)
{
L_Ypos[i] = Math.round(Math.random()*document.body.offsetHeight);
L_Xpos[i] = Math.round(Math.random()*document.body.offsetWidth);
}
document.write('<div id="Outer" style="position:absolute;top:0px;left:0px">');
document.write('<div id="Inner" style="position:relative">');
for (i = 0; i < S_amount; i++)
{document.write('<div id="ieS_star" style="position:absolute;top:'+S_Ypos[i]+';left:'+S_Xpos[i]+';width:1px;height:1px;background:#fffff0;font-size:1px"></div>');}
for (i = 0; i < L_amount; i++)
{document.write('<div id="ieL_star" style="position:absolute;top:'+L_Ypos[i]+';left:'+L_Xpos[i]+';width:2px;height:2px;background:#ffffff;font-size:2px"></div>');}
document.write('</div>');
document.write('</div>');
for (i = 0; i < L_amount; i++)
{
for (j = 0; j < cOlOuRs.length; j++)
{var NewColour=Math.round(Math.random()*[j])}
document.all.ieS_star[i].style.background=cOlOuRs[NewColour];
document.all.ieL_star[i].style.background=cOlOuRs[NewColour];
}
for (i=0; i < ieS_star.length; i++){S_speed[i]=Math.random()*3+1}
for (i=0; i < ieL_star.length; i++){L_speed[i]=Math.random()*7+2}
function ES_go()
{
document.all.Outer.style.pixelTop=document.body.scrollTop;
for (i=0; i < ieS_star.length; i++)
{
ieS_star[i].style.pixelLeft-=S_speed[i];
if (ieS_star[i].style.pixelLeft < -10){ieS_star[i].style.pixelLeft=window.document.body.offsetWidth}
}
S_timer=setTimeout('ES_go()',30);
}
function EL_go()
{
for (i=0; i < ieL_star.length; i++)
{
ieL_star[i].style.pixelLeft-=L_speed[i];
if (ieL_star[i].style.pixelLeft < -10){ieL_star[i].style.pixelLeft=window.document.body.offsetWidth}
}
L_timer=setTimeout('EL_go()',10);
}
function IeStart()
{
ES_go();
EL_go();
}
IeStart()
}
else if (document.layers)
{
for (i = 0; i < S_amount; i++)
{
S_Ypos[i] = Math.round(Math.random()*window.innerHeight);
S_Xpos[i] = Math.round(Math.random()*window.innerWidth);
document.write("<LAYER NAME='S_star"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>");
document.layers["S_star"+i].top = S_Ypos[i];
document.layers["S_star"+i].left = S_Xpos[i];
}
for (i = 0; i < L_amount; i++)
{
L_Ypos[i] = Math.round(Math.random()*window.innerHeight);
L_Xpos[i] = Math.round(Math.random()*window.innerWidth);
document.write("<LAYER NAME='L_star"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,2,2'></LAYER>");
document.layers["L_star"+i].top = L_Ypos[i];
document.layers["L_star"+i].left = L_Xpos[i];
for (j = 0; j < cOlOuRs.length; j++)
{
var NewColour=Math.round(Math.random()*[j]);
}
document.layers['S_star'+i].bgColor=cOlOuRs[NewColour];
document.layers['L_star'+i].bgColor=cOlOuRs[NewColour];
}
for (i=0; i < S_amount; i++){S_speed[i]=Math.random()*3+1}
for (i=0; i < L_amount; i++){L_speed[i]=Math.random()*7+2}
function NS_go()
{
for (i=0; i < S_amount; i++)
{
var temp="S_star"+i;//50
document.layers[temp].top=S_Ypos[i]+window.pageYOffset;
document.layers['S_star'+i].left-=S_speed[i];
if (document.layers['S_star'+i].left < -10){document.layers['S_star'+i].left=window.innerWidth}
}
S_timer=setTimeout('NS_go()',30);
}
function NL_go()
{
for (i=0; i < L_amount; i++)
{
var temp="L_star"+i
document.layers[temp].top=L_Ypos[i]+window.pageYOffset;
document.layers['L_star'+i].left-=L_speed[i];
if (document.layers['L_star'+i].left < -10){document.layers['L_star'+i].left=window.innerWidth}
}
L_timer=setTimeout('NL_go()',10);
}
function NsStart()
{
NS_go();
NL_go();
}
NsStart();
}
window.onresize = new Function("window.location.reload()");
-->
</script>
<div style="position:relative"></div>
在 ("abbbff","ffffee","ffff7a","dffffd","ffaaa0","ffddd0") 中修改星星的顏色 |
在 S_amount = 30; 中修改星星的數量 |
在 L_amount = 10; 中修改星星的大小 |
- Jun 07 Sat 2008 17:53
雪花背景
語法展示:: http://home.graffiti.net/mmnhnfhfg/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
N = 50;
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[i]=Math.round(Math.random()*iH);
X[i]=Math.round(Math.random()*iW);
S[i]=Math.round(Math.random()*5+2);
A[i]=0;
B[i]=Math.random()*0.1+0.1;
M[i]=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[i]+","+M[i]+"'></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[i]+';height:'+M[i]+';background:#fffff0;font-size:'+M[i]+'"></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[i]*Math.sin(90*Math.PI/180);
sx=S[i]*Math.cos(A[i]);
Y[i]+=sy;
X[i]+=sx;
if (Y[i] > H){
Y[i]=-10;
X[i]=Math.round(Math.random()*W);
M[i]=Math.round(Math.random()*1+1);
S[i]=Math.round(Math.random()*5+2);
}
if (V){document.layers['sn'+i].left=X[i];document.layers['sn'+i].top=Y[i]+T}
else{si[i].style.pixelLeft=X[i];si[i].style.pixelTop=Y[i]+T}
A[i]+=B[i];
}
setTimeout('snow()',50);
}
-->
</script>
在 N = 50; 中修改雪花的數量 |
在 setTimeout('snow()',50); 中修改雪花飄落的速度 |
將以下程式碼複製,貼在<body >標籤裡面。
onLoad="snow()"
- Jun 07 Sat 2008 17:46
煙火背景
語法展示:: http://home.graffiti.net/pjjkhhhjghj/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript1.2" TYPE="text/JavaScript">
<!--
var fireNo = 5;
var fireSize = 80;
var speed = 5;
var wa = 6;
var space = 15
var fireColor = new Array('#ffffff','#ff0000','#00ff00','#ffff00','#00ffff','#ff00ff','#ff8000','#ff80ff','#ff0080');
var _dom=(document.all?3:(document.getElementById?1:(document.layers?2:0)));
var fireLay="";
for (i=0; i<fireNo*wa; i++) {
if (_dom == 1 || _dom == 3) {
fireLay += '<DIV id="fire' + i + '" style="position:absolute; width:1px; height:1px left:0px; top=0px; font-size:1px; background:#FFFFFF;"></DIV>';
}
if (_dom == 2) {
fireLay += '<LAYER name="fire'+ i +'" left="0" top="0" clip="0,0,1,1" bgcolor="#FFFFFF"></LAYER>\n';
}
}
document.writeln(fireLay);
function getWindowSize() {
if(_dom == 1 || _dom == 2) {
win_width = self.innerWidth;
win_height = self.innerHeight;
}
if (_dom == 3) {
win_width = document.body.clientWidth;
win_height = document.body.clientHeight;
}
}
function getScrollPosY() {
if (_dom == 1) return scrollY;
if (_dom == 2) return pageYOffset;
if (_dom == 3) return document.body.scrollTop;
}
function showLayer(layerName){
if (_dom == 1) document.getElementById(layerName).style.visibility = "visible";
if (_dom == 2) document.layers[layerName].visibility = "show";
if (_dom == 3) document.all(layerName).style.visibility = "visible";
}
function hideLayer(layerName){
if (_dom == 1) document.getElementById(layerName).style.visibility = "hidden";
if (_dom == 2) document.layers[layerName].visibility = "hide";
if (_dom == 3) document.all(layerName).style.visibility = "hidden";
}
function hanabi() {
for (i=0; i<fireNo*wa; i++) {
if (_dom == 1) var div = document.getElementById("fire" + i).style;
if (_dom == 2) var div = document.layers["fire" + i];
if (_dom == 3) var div = document.all("fire" + i).style;
zure1 = Math.floor(i/fireNo)%2 == 0 ? 0:(Math.PI / fireNo);
zure2 = Math.floor(i/fireNo) * space;
ran = (radius1>(fireSize*0.8)) ? Math.floor(Math.random()*20-10) : 0;
radius2 = (radius1 - zure2) > 0 ? radius1 - zure2 : 0;
if ((radius1 - zure2) > fireSize) { hideLayer("fire" + i); }
else { showLayer("fire" + i); }
div.left = centerX + Math.cos(i * (Math.PI * 2 / fireNo) + zure1) * (radius2) + ran;
div.top = centerY + Math.sin(i * (Math.PI * 2 / fireNo) + zure1) * (radius2) + ran;
if (radius2 < fireSize * 0.4) {
if (_dom == 1 || _dom == 3) {
div.background = startColor;
div.width = 1;
div.height = 1;
}
if (_dom == 2){
div.bgColor = startColor;
div.clip.width = 1;
div.clip.height = 1;
}
} else if (radius2 < fireSize * 0.8) {
if (_dom == 1 || _dom == 3) {
div.width = 2;
div.height = 2;
}
if (_dom == 2){
div.clip.width = 2;
div.clip.height = 2;
}
} else {
if (_dom == 1 || _dom == 3) {
div.background = fireColor[Math.floor(Math.random() * fireColor.length)];
div.width = Math.floor(Math.random()*2+1);
div.height = Math.floor(Math.random()*2+1);
}
if (_dom == 2){
div.bgColor = fireColor[Math.floor(Math.random() * fireColor.length)];
div.clip.width = Math.floor(Math.random()*2+1);
div.clip.height = Math.floor(Math.random()*2+1);
}
}
}
radius1 += speed;
if (radius1 > (fireSize + space * wa)) { setHanabiPos(); }
else { setTimeout("hanabi()",10);}
}
function setHanabiPos() {
rev = 0; radius1 = 0;
getWindowSize(); sclY = getScrollPosY();
startColor = fireColor[Math.floor(Math.random() * fireColor.length)];
centerX = Math.floor(Math.random() * (win_width - (fireSize + space * wa) * 2) + (fireSize + space * wa));
centerY = Math.floor(Math.random() * (win_height - (fireSize + space * wa) * 2) + (fireSize + space * wa)) + sclY;
setTimeout("hanabi()",2000);
}
setHanabiPos();
-->
</script>
在 var fireNo = 5; 中修改煙火的樣式 |
在 var fireSize = 80; 中修改煙火的大小 |
在 var speed = 5; 中修改煙火的展開速度 |
在 var wa = 6; 中修改特效總使用時間 |
在 setTimeout("hanabi()",2000); 中修改煙火之間間隔的時間(每1秒=1000) |
載入中...
- Jun 07 Sat 2008 13:52
翩翩飛舞
語法展示:: http://home.graffiti.net/frdhsww/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
P=new Image();
P.src="move-313.gif";
Pic="move-313.gif";
amount=8;
BY=-25;
BX=-25;
S=1;
/************************ Nothing needs altering below ************************/
ns=(document.layers)?1:0;
if (ns){
for (i=0; i < amount; i++)
document.write("<LAYER NAME='netscape"+i+"' LEFT=0 TOP=0><img src="+Pic+"></LAYER>");
}
else{
document.write("<div style='position:absolute;top:0px;left:0px'><div style='position:relative'>");
for (i=0; i < amount; i++)
{document.write("<img id='explorer' src='"+Pic+"' style='position:absolute;top:0px;left:0px'>")}
document.write("</div></div>")
}
R=new Array(),PB=new Array(),RD=new Array(),Y=new Array(),X=new Array(),D=new Array(),VB=0,HB=0,SP=new Array();;
for (i=0; i < amount; i++){Y[i]=10;X[i]=10;D[i]=Math.floor(Math.random()*80+10);SP[i]=Math.floor(Math.random()*S+3)}
function Curve(){
plusMinus=new Array(1,-1,2,-2,3,-3,0,1,-1)
for (i=0; i < amount; i++){
R[i]=Math.floor(Math.random()*plusMinus.length);
RD[i]=plusMinus[R[i]];
}
setTimeout('Curve()',1800);
}
function MoveRandom(){
T=setTimeout('MoveRandom()',10);
var H=(document.layers)?window.innerHeight:document.body.clientHeight;
var W=(document.layers)?window.innerWidth:document.body.clientWidth;
var YS=(document.layers)?window.pageYOffset:document.body.scrollTop;
var XS=(document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < amount; i++){
PB[i]=D[i]+=RD[i];
y = SP[i]*Math.sin(PB[i]*Math.PI/180);
x = SP[i]*Math.cos(PB[i]*Math.PI/180);
if (D[i] < 0) D[i]+=360;
Y[i]+=y;
X[i]+=x;
VB=180-D[i];
HB=0-D[i];
//Corner rebounds! not necessary but looks nice.
if ((Y[i] < 1) && (X[i] < 1)) {Y[i]=1;X[i]=1;D[i]=45;}
if ((Y[i] < 1) && (X[i] > W+BX)) {Y[i]=1;X[i]=W+BX;D[i]=135;}
if ((Y[i] > H+BY) && (X[i] < 1)) {Y[i]=H+BY;X[i]=1;D[i]=315;}
if ((Y[i] > H+BY) && (X[i] > W+BX)) {Y[i]=H+BY;X[i]=W+BX;D[i]=225;}
//Edge rebounds!
if (Y[i] < 1) {Y[i]=1;D[i]=HB;}
if (Y[i] > H+BY) {Y[i]=H+BY;D[i]=HB;}
if (X[i] < 1) {X[i]=1;D[i]=VB;}
if (X[i] > W+BX) {X[i]=W+BX;D[i]=VB;}
var layer=(document.layers)?document.layers['netscape'+i]:explorer[i].style;
layer.top=Y[i]+YS;
layer.left=X[i]+XS;
}
}
function sTaRt(){Curve();MoveRandom()}
if (document.all||document.layers){sTaRt()}
//-->
</script>
記得將這隻蝴蝶 抓回去唷
- Jun 04 Wed 2008 21:19
魚兒水中游
語法展示:: http://home.graffiti.net/lpgytdf/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
<!--在此修改圖案出現在畫面上的數量-->
var no = 10;
<!--在此修改圖案游動的速度,數值越大越慢,越小越快-->
var speed = 10;
snow = new Array();
<!--在此修改需使用的圖案連結路徑-->
snow[0] = "圖檔連結路徑";
snow[1] = "圖檔連結路徑";
snow[2] = "圖檔連結路徑";
snow[3] = "圖檔連結路徑";
snow[4] = "圖檔連結路徑";
snow[5] = "圖檔連結路徑";
var maxsize = 100;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
var j = 0;
for (i = 0; i < no; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_height-maxsize);
yp[i] = Math.random()*(doc_width-maxsize);
am[i] = Math.random()*10;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + snow[j] + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + snow[j] + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + snow[j] + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + snow[j] + "\" border=\"0\"></div>");
} }
if (j == (snow.length-1)) { j = 0; } else { j += 1; }
}
document.write("<div id=\"damy\" style=\"POSITION: absolute; width:1; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: " + (doc_width+maxsize) + "px;\"> </div>");
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
if (i%2) {
yp[i] += sty[i];
if (yp[i] > doc_width) {
xp[i] = Math.random()*(doc_height-am[i]-maxsize);
yp[i] = 0-maxsize;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
} else {
yp[i] -= sty[i];
if (yp[i] < -maxsize) {
xp[i] = Math.random()*(doc_height-am[i]-maxsize);
yp[i] = doc_width;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} }
dx[i] += stx[i];
document.layers["dot"+i].top = xp[i] + am[i]*Math.sin(dx[i]);
document.layers["dot"+i].left = yp[i];
}
setTimeout("snowNS()", speed);
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
if (i%2) {
yp[i] += sty[i];
if (yp[i] > doc_width) {
xp[i] = Math.random()*(doc_height-am[i]-maxsize);
yp[i] = 0-maxsize;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
} else {
yp[i] -= sty[i];
if (yp[i] < -maxsize) {
xp[i] = Math.random()*(doc_height-am[i]-maxsize);
yp[i] = doc_width;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
} }
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = xp[i] + am[i]*Math.sin(dx[i]);
document.all["dot"+i].style.pixelLeft = yp[i];
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
//-->
</script>
將 這幾條魚按右鍵下載回去唷
- Jun 04 Wed 2008 21:11
璀璨煙火
語法展示:: http://home.graffiti.net/lqagvfgfd/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!--
var uti = true;
var speed = 6;
var fireSize = 180;
var fireNo = 6;
var wa = 4;
var space = 15;
var img = "line-58.gif";
var _dom=(document.all?3:(document.getElementById?1:(document.layers?2:0)));
var fireLay="";
for (i=0; i<fireNo*wa; i++) {
if (_dom == 1 || _dom == 3) {
fireLay += '<DIV id="fire' + i + '" style="position:absolute; width:1px; height:1px left:-100px; top=-100px;"><IMG src="' + img + '"></DIV>';
}
if (_dom == 2) {
fireLay += '<LAYER name="fire'+ i +'" left="-100" top="-100"><IMG src="' + img + '"></LAYER>\n';
}
}
document.writeln(fireLay);
function getWindowSize() {
if(_dom == 1 || _dom == 2) {
win_width = self.innerWidth;
win_height = self.innerHeight;
}
if (_dom == 3) {
win_width = document.body.clientWidth;
win_height = document.body.clientHeight;
}
}
function showLayer(layerName){
if (_dom == 1) document.getElementById(layerName).style.visibility = "visible";
if (_dom == 2) document.layers[layerName].visibility = "show";
if (_dom == 3) document.all(layerName).style.visibility = "visible";
}
function hideLayer(layerName){
if (_dom == 1) document.getElementById(layerName).style.visibility = "hidden";
if (_dom == 2) document.layers[layerName].visibility = "hide";
if (_dom == 3) document.all(layerName).style.visibility = "hidden";
}
function moveLayerTo(layerName, x, y){
if (_dom == 1) {
document.getElementById(layerName).style.left = x + scrollX;
document.getElementById(layerName).style.top = y + scrollY;
}
if (_dom == 2) {
document.layers[layerName].left = x + pageXOffset;
document.layers[layerName].top = y + pageYOffset;
}
if (_dom == 3) {
document.all(layerName).style.pixelLeft = x + document.body.scrollLeft
document.all(layerName).style.pixelTop = y + document.body.scrollTop;
}
}
function utiage(layerName,sx,sy,ex,ey,dl,sp) {
var l, xp, yp, tim, z, dl2;
l=Math.abs(Math.sqrt(Math.pow((ex-sx),2)+Math.pow((ey-sy),2)));
z = Math.floor(l / dl); dl2 = l / z;
if (Math.floor(l) != 0) {
xp = dl2/l*(ex-sx)+sx;
if (ex-sx == 0) {
if (sy<ey) yp = sy+dl2;
else yp = sy-dl2;
} else yp = (sy-ey)/(sx-ex)*xp+sy-(sy-ey)/(sx-ex)*sx;
moveLayerTo(layerName,xp,yp);
tim = setTimeout("utiage('"+layerName+"',"+xp+","+yp+","+ex+","+ey+","+dl+","+sp+")",sp);
} else {
hideLayer(layerName);
setTimeout("hanabi()",100);
}
}
function hanabi() {
for (i=0; i<fireNo*wa; i++) {
zure1 = Math.floor(i/fireNo)%2 == 0 ? 0:(Math.PI / fireNo);
zure2 = Math.floor(i/fireNo) * space;
ran = (radius1>(fireSize*0.8)) ? Math.floor(Math.random()*20-10) : 0;
radius2 = (radius1 - zure2) > 0 ? radius1 - zure2 : 0;
if ((radius1 - zure2) > fireSize) { hideLayer("fire" + i); }
else { showLayer("fire" + i); }
moveLayerTo("fire" + i, centerX + Math.cos(i * (Math.PI * 2 / fireNo) + zure1) * (radius2) + ran, centerY + Math.sin(i * (Math.PI * 2 / fireNo) + zure1) * (radius2) + ran);
}
radius1 += speed;
if (radius1 > (fireSize + space * wa)) { setHanabiPos(); }
else { setTimeout("hanabi()",10);}
}
function setHanabiPos() {
rev = 0; radius1 = 0;
getWindowSize();
centerX = Math.floor(Math.random() * (win_width - (fireSize + space * wa) * 2) + (fireSize + space * wa));
centerY = Math.floor(Math.random() * (win_height - (fireSize + space * wa) * 2) + (fireSize + space * wa));
if (uti) {
showLayer("fire0");
utiage("fire0",centerX,(win_height + 50),centerX,centerY,speed,10);
} else setTimeout("hanabi()",1000);
}
if (_dom) setHanabiPos();
// -->
</SCRIPT>
記得將 這個圖片下載回去唷^^
- Jun 04 Wed 2008 21:05
櫻花之戀
語法展示:: http://home.graffiti.net/kggfhgh/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<SCRIPT Language="JavaScript">
//Pre-load your image below!
grphcs=new Array(6)
Image0=new Image();
Image0.src=grphcs[0]="figure67071.gif"; //指定這個特效所用的圖片
Image1=new Image();
Image1.src=grphcs[1]="figure67073.gif" //指定這個特效所用的圖片
Image2=new Image();
Image2.src=grphcs[2]="figure67074.gif" //指定這個特效所用的圖片
Image3=new Image();
Image3.src=grphcs[3]="figure67075.gif" //指定這個特效所用的圖片
Image4=new Image();
Image4.src=grphcs[4]="figure67071.gif" //指定這個特效所用的圖片
Image5=new Image();
Image5.src=grphcs[5]="figure67074.gif" //指定這個特效所用的圖片
Amount=4; //Smoothness depends on image file size, the smaller the size the more you can use!
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
Ypos[i] = Math.round(Math.random()*WinHeight);
Xpos[i] = Math.round(Math.random()*WinWidth);
Speed[i]= Math.random()*5+3;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
}
function fall(){
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(90*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else if (ns6){
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
}
else{
eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',15);
}
window.onload=fall
</SCRIPT>
記得把這幾片葉子帶回去唷 → 按右鍵另存
- Jun 04 Wed 2008 20:52
流星背景
語法展示:: http://home.graffiti.net/zxdfdfds/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script>
<!--
var useFlash = navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
if ((navigator.userAgent.indexOf("Win")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1)) {
document.writeln('<SCRIPT LANGUAGE="VBScript">');
document.writeln('On error resume next');
document.writeln('useFlash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))');
document.write('</SCR');
document.writeln('IPT>');
}
browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion);
if (browser_name == "Microsoft Internet Explorer" && browser_version == 4.0) {
if (useFlash) {
document.write('<object ID="SWFLASH"');
document.write('classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('STYLE="POSITION: absolute; HEIGHT:101%;WIDTH:100%;TOP:0;LEFT:0;VISIBILITY:VISIBLE; ZINDEX:1"');
document.write('width=1 height=1 ALIGN=right>');
document.write('<param name=movie value="06_14.swf">'); //執行流星背景 的 swf檔 路徑
document.write('<param name=wmode value="transparent">');
document.write('</OBJECT>');
}
}
//-->
</script>
不要忘記付件也要一起帶回家喔~!!...... >>>>>>我是附件帶我回家<<<<<<<
置於網頁同一目錄下
- Jun 04 Wed 2008 20:40
流星飛舞
語法展示:: http://home.graffiti.net/qzxsd/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<div id="sDiv0">*</div>
<div id="sDiv1">*</div>
<div id="sDiv2">*</div>
<div id="sDiv3">*</div>
<div id="sDiv4">*</div>
<div id="sDiv5">*</div>
<div id="sDiv6">*</div>
<p></p>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
/*
Document firework script (By Matt Gabbert, mgabbert@usrtoday.com, http://www.nolag.com)
Modified and permission granted to Dynamic Drive to feature script in archive
For full source and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
//set Interval between each firework display,
var intervals=2000
var sparksOn = true;
var speed = 40;
var power = 3;
//Dont change these values-------
var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0
var ns=(document.layers);
var ie=(document.all);
var sparksAflyin = false;
var allDivs = new Array(10);
var totalSparks = 0;
//-------------------------------
function initAll(){
if(!ns && !ie){
sparksOn = false;
return;
}
setInterval("firework()",intervals)
if (ns)
document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
for(dNum=0; dNum<7; ++dNum){
if(ie)
allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');
else
allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');
}
}
function firework(){
//below code detects the browser dimenions
if (ie){
documentWidth=document.body.clientWidth
documentHeight=document.body.clientHeight
leftcorner=document.body.scrollLeft
topcorner=document.body.scrollTop
}
else if (ns){
documentWidth=window.innerWidth
documentHeight=window.innerHeight
leftcorner=pageXOffset
topcorner=pageYOffset
}
//below code randomly generates a set of coordinates that fall within the dimension
randomx=leftcorner+Math.floor(Math.random()*documentWidth)
randomy=topcorner+Math.floor(Math.random()*documentHeight)
if(sparksOn){
if(!sparksAflyin){
sparksAflyin=true;
totalSparks=0;
for(var spark=0;spark<=6;spark++){
dx=Math.round(Math.random()*50);
dy=Math.round(Math.random()*50);
moveTo(spark,randomx,randomy,dx,dy);
}
}
}
}
function moveTo(i,tempx,tempy,dx,dy){
if(ie){
if(tempy+80>(document.body.offsetHeight+document.body.scrollTop))
tempy=document.body.offsetHeight+document.body.scrollTop-80;
if(tempx+80>(document.body.offsetWidth+document.body.scrollLeft))
tempx=document.body.offsetWidth+document.body.scrollLeft-80;
}
if(tempx>-50&&tempy>-50){
tempx+=dx;tempy+=dy;
allDivs[i].left=tempx;
allDivs[i].top=tempy;
dx-=power;dy-=power;
setTimeout("moveTo("+i+","+tempx+","+tempy+","+dx+","+dy+")",speed)
}
else
++totalSparks
if(totalSparks==7){
sparksAflyin=false;
totalSparks=0;
}
}
window.onload=initAll
//End-->
</script>
<script language="JavaScript">
cOlOuRs=new Array("abbbff","ffffee","ffff7a","dffffd","ffaaa0","ffddd0")
S_amount = 30;//number of small stars!!!!!
L_amount = 15;//number of larger stars!!!!
S_Ypos = new Array();
S_Xpos = new Array();
L_Ypos = new Array();
L_Xpos = new Array();
S_speed= new Array();
L_speed= new Array();
if (document.all)
{
for (i = 0; i < S_amount; i++)
{
S_Ypos[i] = Math.round(Math.random()*document.body.offsetHeight);
S_Xpos[i] = Math.round(Math.random()*document.body.offsetWidth);
}
for (i = 0; i < L_amount; i++)
{
L_Ypos[i] = Math.round(Math.random()*document.body.offsetHeight);
L_Xpos[i] = Math.round(Math.random()*document.body.offsetWidth);
}
document.write('<div id="Outer" style="position:absolute;top:0px;left:0px">');
document.write('<div id="Inner" style="position:relative">');
for (i = 0; i < S_amount; i++)
{document.write('<div id="ieS_star" style="position:absolute;top:'+S_Ypos[i]+';left:'+S_Xpos[i]+';width:1px;height:1px;background:#fffff0;font-size:1px"></div>');}
for (i = 0; i < L_amount; i++)
{document.write('<div id="ieL_star" style="position:absolute;top:'+L_Ypos[i]+';left:'+L_Xpos[i]+';width:2px;height:2px;background:#ffffff;font-size:2px"></div>');}
document.write('</div>');
document.write('</div>');
for (i = 0; i < L_amount; i++)
{
for (j = 0; j < cOlOuRs.length; j++)
{var NewColour=Math.round(Math.random()*[j])}
document.all.ieS_star[i].style.background=cOlOuRs[NewColour];
document.all.ieL_star[i].style.background=cOlOuRs[NewColour];
}
for (i=0; i < ieS_star.length; i++){S_speed[i]=Math.random()*3+1}
for (i=0; i < ieL_star.length; i++){L_speed[i]=Math.random()*7+2}
function ES_go()
{
document.all.Outer.style.pixelTop=document.body.scrollTop;
for (i=0; i < ieS_star.length; i++)
{
ieS_star[i].style.pixelLeft-=S_speed[i];
if (ieS_star[i].style.pixelLeft < -10){ieS_star[i].style.pixelLeft=window.document.body.offsetWidth}
}
S_timer=setTimeout('ES_go()',30);
}
function EL_go()
{
for (i=0; i < ieL_star.length; i++)
{
ieL_star[i].style.pixelLeft-=L_speed[i];
if (ieL_star[i].style.pixelLeft < -10){ieL_star[i].style.pixelLeft=window.document.body.offsetWidth}
}
L_timer=setTimeout('EL_go()',10);
}
function IeStart()
{
ES_go();
EL_go();
}
IeStart()
}//End Explorer
else if (document.layers)
{
for (i = 0; i < S_amount; i++)
{
S_Ypos[i] = Math.round(Math.random()*window.innerHeight);
S_Xpos[i] = Math.round(Math.random()*window.innerWidth);
document.write("<LAYER NAME='S_star"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>");
document.layers["S_star"+i].top = S_Ypos[i];
document.layers["S_star"+i].left = S_Xpos[i];
}
for (i = 0; i < L_amount; i++)
{
L_Ypos[i] = Math.round(Math.random()*window.innerHeight);
L_Xpos[i] = Math.round(Math.random()*window.innerWidth);
document.write("<LAYER NAME='L_star"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,2,2'></LAYER>");
document.layers["L_star"+i].top = L_Ypos[i];
document.layers["L_star"+i].left = L_Xpos[i];
for (j = 0; j < cOlOuRs.length; j++)
{
var NewColour=Math.round(Math.random()*[j]);
}
document.layers['S_star'+i].bgColor=cOlOuRs[NewColour];
document.layers['L_star'+i].bgColor=cOlOuRs[NewColour];
}
for (i=0; i < S_amount; i++){S_speed[i]=Math.random()*3+1}
for (i=0; i < L_amount; i++){L_speed[i]=Math.random()*7+2}
function NS_go()
{
for (i=0; i < S_amount; i++)
{
var temp="S_star"+i;//50
document.layers[temp].top=S_Ypos[i]+window.pageYOffset;
document.layers['S_star'+i].left-=S_speed[i];
if (document.layers['S_star'+i].left < -10){document.layers['S_star'+i].left=window.innerWidth}
}
S_timer=setTimeout('NS_go()',30);
}
function NL_go()
{
for (i=0; i < L_amount; i++)
{
var temp="L_star"+i
document.layers[temp].top=L_Ypos[i]+window.pageYOffset;
document.layers['L_star'+i].left-=L_speed[i];
if (document.layers['L_star'+i].left < -10){document.layers['L_star'+i].left=window.innerWidth}
}
L_timer=setTimeout('NL_go()',10);
}
function NsStart()
{
NS_go();
NL_go();
}
NsStart();
}//End Netscape
window.onresize = new Function("window.location.reload()");
//-->
</script>
將以下程式碼複製,貼在<head>及</head>標籤之間。
<style>
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:Aqua;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:red;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:blue;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:orange;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:yellow;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:lightgreen;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:silver;}
</style>
- Jun 04 Wed 2008 20:21
星際特效
語法展示:: http://home.graffiti.net/gtdsdsadsa/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<SCRIPT language=JavaScript>
<!--annie
if (document.all){
xL=6;
xH=0;
xW=0;
xR=0;
xE=0;
xMY=0;
xMX=0;
xWd=0;
xHd=0;
xF=new Array();
xY=new Array();
xX=new Array();
xS=new Array();
xA=new Array();
xB=new Array();
ini=new Array();
cl=new Array('#fff000','#0000FF','#ff0000','#00ff00','#ff00ff','#ffa500')
document.write('<div id="xouter" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < xL; i++){
document.write('<div id="xie" style="position:absolute;top:0;left:0;width:10px;height:10px;'
+'font-family:Courier New;font-size:50px;color:#ffffff">.</div>');
}
document.write('</div></div>');
//Initial Placement!
function Set(){
for (i=0; i < xL; i++){
xH=window.document.body.offsetHeight;
xW=window.document.body.offsetWidth;
xA[i]=Math.round(Math.random()*xH);
xB[i]=Math.round(Math.random()*xW);
xS[i]=Math.random()*0.07+0.05;
xR=Math.round(Math.random()*3);
xE=Math.round(Math.random()*2500+50)
if (xR == 3) xB[i]=-xE;
if (xR == 2) xB[i]=xW+xE;
if (xR == 1) xA[i]=-xE;
if (xR == 0) xA[i]=xH;
xF[i]=xW/14;
}
}
Set();
function Assign(){
xouter.style.top=document.body.scrollTop;
for (i=0; i < xL; i++){
xF[i]-=xS[i]*25;
if (xF[i] < 4) xF[i]=3;
xie[i].style.top =xY[i];
xie[i].style.left=xX[i];
xie[i].style.fontSize=xF[i];
xie[i].style.filter='glow(color='+ini[i]+', strength='+xF[i]/3+')';
}
}
function fly(){
var N=Math.floor(Math.random()*cl.length)
xMY=window.document.body.clientHeight/2;
xMX=window.document.body.clientWidth/2;
xWd=Math.round(Math.random()*40+5);
xHd=Math.round(Math.random()*30+5);
for (i=0; i < xL; i++)
{
xY[i]=xA[i]+=(xMY-xA[i])*(xS[i]);
xX[i]=xB[i]+=(xMX-xB[i])*(xS[i]);
if ((xX[i] > xMX-xWd) && (xX[i] < xMX+xWd) && (xY[i] > xMY-xHd) && (xY[i] < xMY+xHd)){
xH=window.document.body.offsetHeight;
xW=window.document.body.offsetWidth;
xA[i]=Math.round(Math.random()*xH);
xB[i]=Math.round(Math.random()*xW);
xS[i]=Math.random()*0.05+0.05;
xR=Math.round(Math.random()*3);
xE=Math.round(Math.random()*50+50)
if (xR == 3) xB[i]=-xE;
if (xR == 2) xB[i]=xW+xE;
if (xR == 1) xA[i]=-xE;
if (xR == 0) xA[i]=xH+xE;
}
if ((xX[i] < 0) || (xX[i] > xW) || (xY[i] < 0) || (xY[i] > xH))
{
xF[i]=xW/14;
ini[i]=cl[N];
}
}
Assign();
setTimeout('fly()',10);
}
fly();
}
//annie -->
</SCRIPT>
- Jun 04 Wed 2008 20:15
仿Flash效果
語法展示:: http://home.graffiti.net/cvfgggfd/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<div align="center">
<table border="0" width="339" height="247">
<tr>
<td width="167" height="113" valign="middle" align="center"><a onmouseover="showrings()" onmouseout="hiderings()" href="http://blog.pixnet.net/como0925"><img border="0" src="圖片網址
" width="34" height="27"></a></td>
<td width="168" height="113" valign="middle" align="center"><a onmouseout="hiderings()" onmouseover="showrings()" href="http://blog.pixnet.net/como0925"><img border="0" src="圖片網址" width="31" height="31"></a></td>
</tr>
</table>
</div>
將以下程式碼複製,貼在<head>及</head>標籤之間。
<script>
// CREDITS:
// Flashlike rollover-animation for all your links
// by Urs Dudli and Peter Gehrig
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com/fast/index.html
// info@24fun.com
// 11/14/2000
// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a link to http://www.24fun.com/fast/index.html on the webpage
// where this script will be running.
// the number of rings
var ringnumber=4
// do not edit the code below
var x,y
var timer
var i_fontsize=new Array
var step=new Array
ringnumber=ringnumber-1
var maxfontsize=600
var startfontsize=1
for (i=0;i<=ringnumber;i++) {
i_fontsize[i]=startfontsize
step[i]=ringnumber*i*10
startfontsize=(maxfontsize/ringnumber)*(i+1)
}
function cursorposition(e){
x=event.clientX+document.body.scrollLeft
y=event.clientY+document.body.scrollTop
}
function showrings() {
if (document.all) {
for (i=0;i<=ringnumber;i++) {
if (i_fontsize[i]>=maxfontsize) {i_fontsize[i]=1;step[i]=1}
var thisring=eval("document.all.ring"+i+".style")
thisring.visibility="visible"
thisring.fontSize=i_fontsize[i]
thisring.color="rgb("+Math.floor(i_fontsize[i]/2.0)+","+Math.floor(i_fontsize[i]/2.0)+",255)"
thisring.posLeft=x-(Math.floor(i_fontsize[i]/3))
thisring.posTop=y-(Math.floor(i_fontsize[i]/1.4))
step[i]+=2
i_fontsize[i]+=step[i]
}
timer=setTimeout("showrings()",50)
}
}
function hiderings(e){
if (document.all) {
clearTimeout(timer)
startfontsize=0
for (i=0;i<=ringnumber;i++) {
thisring=eval("document.all.ring"+i+".style")
thisring.visibility="hidden"
i_fontsize[i]=startfontsize
step[i]=ringnumber*i*10
startfontsize=Math.floor((maxfontsize/ringnumber))*(i+1)
}
}
}
if (document.all) {
document.onmousemove=cursorposition;
}
if (document.all) {
for (i=0;i<=ringnumber;i++) {
document.write("<DIV id='ring"+i+"' style='position:absolute;font-family:Verdana;visibility:hidden;'>O</DIV>")
}
document.write("<DIV style='position:relative;'>")
}
</script>
- Jun 04 Wed 2008 20:04
下雪特效
語法展示:: http://home.graffiti.net/htgfddds/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<applet code="ansnow.class" width=553 height=351>
<param name=credits value="Applet by Fabio Ciucci (www.anfyteam.com)">
<param name=regcode value="NO">
<param name=reglink value="NO">
<param name=regnewframe value="YES">
<param name=regframename value="_blank">
<param name=statusmsg value="Snow">
<param name=flakes1 value="500">
<param name=flakes2 value="300">
<param name=flakes3 value="100">
<param name=flakes4 value="8">
<param name=windmax value="1">
<param name=windvariation value="7">
<param name=speed value="8">
<param name=backimage value="下雪特效底圖">
<param name=bgcolor value="000133">
<param name=overtext value="NO">
<param name=overimg value="NO">
<param name=overimgX value="0">
<param name=overimgY value="0">
<param name=memdelay value="1000">
<param name=priority value="3">
<param name=MinSYNC value="10">
Sorry, your browser doesn't support Java.
</applet>
不要忘記付件也要一起帶回家喔~!!...... >>>>>>我是附件帶我回家<<<<<<<
下載後解壓縮,置於網頁同一目錄下
- Jun 04 Wed 2008 19:55
落葉飄飄
語法展示:: http://home.graffiti.net/dfhthfdx/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script LANGUAGE="JavaScript1.2">
<!--
var no = 10;
var speed = 10;
var snowflake = "figure-7.gif";
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 1024, doc_height = 768;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_width-50);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
//-->
</script>
不要忘記付件也要一起帶回家喔~!!...... >>>>>>我是附件帶我回家<<<<<<<
將圖檔置於網頁同一目錄下
- Jun 04 Wed 2008 19:49
漂亮的流星雨
語法展示:: http://home.graffiti.net/acfrddfds/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript1.2">
<!--
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && self.innerWidth && (window.pageXOffset>-1));
//my way of making sure the browser will have what I need
var allDivs = new Array(14);
var documentWidth,documentHeight;
function initAll(){
if(!ns && !ie && !w3) return;
for(dNum=0; dNum<10; ++dNum){
if(ie) allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');
else if(ns) allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');
else if(w3) allDivs[dNum]=eval('document.getElementById("sDiv'+dNum+'").style');
moveTo(dNum,0,0);
}
}
function moveTo(i,tempx,tempy){
if (ie){
documentWidth =document.body.offsetWidth+document.body.scrollLeft-20;
randomy=Math.floor(Math.random()*document.body.offsetHeight)+document.body.scrollTop-20;
}
else if (ns){
documentWidth=window.innerWidth+window.pageXOffset-20;
randomy=Math.floor(Math.random()*window.innerHeight)+window.pageYOffset-20;
}
else if (w3){
documentWidth=self.innerWidth+window.pageXOffset-20;
randomy=Math.floor(Math.random()*self.innerHeight)+window.pageYOffset-20;
}
if(tempx>-50){
tempx-=45;
allDivs[i].left=tempx;
allDivs[i].top =tempy;
setTimeout("moveTo("+i+","+tempx+","+tempy+")",40)
}
else
setTimeout("moveTo("+i+",documentWidth-60,randomy)",2000/i+40);
}
window.onload=initAll
//End-->
</script>
<div id="sDiv0">
*
</div>
<div id="sDiv1">
*
</div>
<div id="sDiv2">
*
</div>
<div id="sDiv3">
*
</div>
<div id="sDiv4">
*
</div>
<div id="sDiv5">
*
</div>
<div id="sDiv6">
*
</div>
<div id="sDiv7">
*
</div>
<div id="sDiv8">
*
</div>
<div id="sDiv9">
*
</div>
<div id="sDiv10">
*
</div>
<div id="sDiv11">
*
</div>
<div id="sDiv12">
*
</div>
<div id="sDiv13">
*
</div>
將以下程式碼複製,貼在<head>及</head>標籤之間。
<style type="text/css">
<!--
.mt
{
font-size:16px;
color:66FF99;
}
A:ACTIVE, A:LINK, A:VISITED
{
font-size:11px;
color : ffffcc;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-weight : bold;
text-decoration : none;
}
A:HOVER
{
color : 009F8C;
text-decoration : underline;
}
BODY {
background-color : black;
scrollbar-track-color : black;
}
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:Aqua;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:red;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:blue;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:orange;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:yellow;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:Aqua;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:red;}
#sDiv7 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:blue;}
#sDiv8 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:orange;}
#sDiv9 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:yellow;}
#sDiv10 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:66ffff;}
#sDiv11 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:ff6600;}
#sDiv12 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:ff3300;}
#sDiv13 {position:absolute; height:1; width:1; font-family:arial black; font-size:16px; color:00ff66;}
//-->
</style>
- May 31 Sat 2008 17:49
煙火背景
語法展示:: http://home.graffiti.net/pjjkhhhjghj/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript1.2" TYPE="text/JavaScript">
<!--
var fireNo = 5;
var fireSize = 80;
var speed = 5;
var wa = 6;
var space = 15
var fireColor = new Array('#ffffff','#ff0000','#00ff00','#ffff00','#00ffff','#ff00ff','#ff8000','#ff80ff','#ff0080');
var _dom=(document.all?3:(document.getElementById?1:(document.layers?2:0)));
var fireLay="";
for (i=0; i<fireNo*wa; i++) {
if (_dom == 1 || _dom == 3) {
fireLay += '<DIV id="fire' + i + '" style="position:absolute; width:1px; height:1px left:0px; top=0px; font-size:1px; background:#FFFFFF;"></DIV>';
}
if (_dom == 2) {
fireLay += '<LAYER name="fire'+ i +'" left="0" top="0" clip="0,0,1,1" bgcolor="#FFFFFF"></LAYER>\n';
}
}
document.writeln(fireLay);
function getWindowSize() {
if(_dom == 1 || _dom == 2) {
win_width = self.innerWidth;
win_height = self.innerHeight;
}
if (_dom == 3) {
win_width = document.body.clientWidth;
win_height = document.body.clientHeight;
}
}
function getScrollPosY() {
if (_dom == 1) return scrollY;
if (_dom == 2) return pageYOffset;
if (_dom == 3) return document.body.scrollTop;
}
function showLayer(layerName){
if (_dom == 1) document.getElementById(layerName).style.visibility = "visible";
if (_dom == 2) document.layers[layerName].visibility = "show";
if (_dom == 3) document.all(layerName).style.visibility = "visible";
}
function hideLayer(layerName){
if (_dom == 1) document.getElementById(layerName).style.visibility = "hidden";
if (_dom == 2) document.layers[layerName].visibility = "hide";
if (_dom == 3) document.all(layerName).style.visibility = "hidden";
}
function hanabi() {
for (i=0; i<fireNo*wa; i++) {
if (_dom == 1) var div = document.getElementById("fire" + i).style;
if (_dom == 2) var div = document.layers["fire" + i];
if (_dom == 3) var div = document.all("fire" + i).style;
zure1 = Math.floor(i/fireNo)%2 == 0 ? 0:(Math.PI / fireNo);
zure2 = Math.floor(i/fireNo) * space;
ran = (radius1>(fireSize*0.8)) ? Math.floor(Math.random()*20-10) : 0;
radius2 = (radius1 - zure2) > 0 ? radius1 - zure2 : 0;
if ((radius1 - zure2) > fireSize) { hideLayer("fire" + i); }
else { showLayer("fire" + i); }
div.left = centerX + Math.cos(i * (Math.PI * 2 / fireNo) + zure1) * (radius2) + ran;
div.top = centerY + Math.sin(i * (Math.PI * 2 / fireNo) + zure1) * (radius2) + ran;
if (radius2 < fireSize * 0.4) {
if (_dom == 1 || _dom == 3) {
div.background = startColor;
div.width = 1;
div.height = 1;
}
if (_dom == 2){
div.bgColor = startColor;
div.clip.width = 1;
div.clip.height = 1;
}
} else if (radius2 < fireSize * 0.8) {
if (_dom == 1 || _dom == 3) {
div.width = 2;
div.height = 2;
}
if (_dom == 2){
div.clip.width = 2;
div.clip.height = 2;
}
} else {
if (_dom == 1 || _dom == 3) {
div.background = fireColor[Math.floor(Math.random() * fireColor.length)];
div.width = Math.floor(Math.random()*2+1);
div.height = Math.floor(Math.random()*2+1);
}
if (_dom == 2){
div.bgColor = fireColor[Math.floor(Math.random() * fireColor.length)];
div.clip.width = Math.floor(Math.random()*2+1);
div.clip.height = Math.floor(Math.random()*2+1);
}
}
}
radius1 += speed;
if (radius1 > (fireSize + space * wa)) { setHanabiPos(); }
else { setTimeout("hanabi()",10);}
}
function setHanabiPos() {
rev = 0; radius1 = 0;
getWindowSize(); sclY = getScrollPosY();
startColor = fireColor[Math.floor(Math.random() * fireColor.length)];
centerX = Math.floor(Math.random() * (win_width - (fireSize + space * wa) * 2) + (fireSize + space * wa));
centerY = Math.floor(Math.random() * (win_height - (fireSize + space * wa) * 2) + (fireSize + space * wa)) + sclY;
setTimeout("hanabi()",2000);
}
setHanabiPos();
-->
</script>在 var fireNo = 5; 中修改煙火的樣式 在 var fireSize = 80; 中修改煙火的大小 在 var speed = 5; 中修改煙火的展開速度 在 var wa = 6; 中修改特效總使用時間 在 setTimeout("hanabi()",2000); 中修改煙火之間間隔的時間(每1秒=1000)
- May 31 Sat 2008 17:43
雪花背景
語法展示:: http://home.graffiti.net/mmnhnfhfg/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
N = 50;
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[i]=Math.round(Math.random()*iH);
X[i]=Math.round(Math.random()*iW);
S[i]=Math.round(Math.random()*5+2);
A[i]=0;
B[i]=Math.random()*0.1+0.1;
M[i]=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[i]+","+M[i]+"'></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[i]+';height:'+M[i]+';background:#fffff0;font-size:'+M[i]+'"></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[i]*Math.sin(90*Math.PI/180);
sx=S[i]*Math.cos(A[i]);
Y[i]+=sy;
X[i]+=sx;
if (Y[i] > H){
Y[i]=-10;
X[i]=Math.round(Math.random()*W);
M[i]=Math.round(Math.random()*1+1);
S[i]=Math.round(Math.random()*5+2);
}
if (V){document.layers['sn'+i].left=X[i];document.layers['sn'+i].top=Y[i]+T}
else{si[i].style.pixelLeft=X[i];si[i].style.pixelTop=Y[i]+T}
A[i]+=B[i];
}
setTimeout('snow()',50);
}
-->
</script>在 N = 50; 中修改雪花的數量 在 setTimeout('snow()',50); 中修改雪花飄落的速度
將以下程式碼複製,貼在<body >標籤裡面。
onLoad="snow()"