2007-7-8 03:13
扎肉瘦腿
有公仔散落在板面(放起website)
有公仔散落在板面(放起website)
[img]http://img108.exs.cx/img108/3996/fallingisamepicture2ly.jpg[/img]
[code]<SCRIPT language=JavaScript>
st=setTimeout;
change='';
var no = 10; // number of picture appear
var speed = 50; // smaller value will move more faster
var falling = "網址"; // image URL
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 600, doc_height = 800;
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 = 0;
xp = Math.random()*(doc_width-50);
yp = Math.random()*doc_height;
am = Math.random()*20;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
if (ns4up) {
if (i == 0) {
document.write("<layer name="dot\"+ i +"" left="20" top="10" visibility="show"><img src="" + falling + "" border="0"></layer>");
} else {
document.write("<layer name="dot"+ i +"" left="20" top="10" visibility="show"><img src="" + falling + "" border="0"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id="dot\"+ i +"" style="POSITION: abso"+change+"lute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 10px; LEFT: 20px;"><img src="" + falling + "" border="0"></div>");
} else {
document.write("<div id="dot\"+ i +"" style="POSITION: abso"+change+"lute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 10px; LEFT: 20px;"><img src="" + falling + "" border="0"></div>");
} } }
function snowNS() {
for (i = 0; i < no; ++ i) {
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx += stx;
document.layers["dot"+i].top = yp;
document.layers["dot"+i].left = xp + am*Math.sin(dx);
}
st("snowNS()", speed);
}
function snowIE() {
for (i = 0; i < no; ++ i) {
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7+ Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight; //You May change to 1550 or bigger number to let the image fall until down
}
dx += stx;
document.all["dot"+i].style.pixelTop = yp;
document.all["dot"+i].style.pixelLeft = xp + am*Math.sin(dx);
}
st("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</SCRIPT> [/code]