页面上桃花飘飘
[ 发布者:luwei┊来源:本站整理┊时间:2005-10-23┊浏览:
人次 ]
网页特效|Linkweb.cn/Js|---页面上桃花飘飘
|
var plumsrc="images/flower.gif"
// Configure below to change number of plum to render
var no = 15;
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
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();
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
} else {
document.write("");
}
} else if (ie4up) {
if (i == 0) {
document.write("
");} else {
document.write("
}
}
}
function plumNS() { // 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("plumNS()", 10);
}
function plumIE() { // 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("plumIE()", 10);
}
if (ns4up) {
plumNS();
} else if (ie4up) {
plumIE();
}
st=n=m=0;k=9;ns=navigator.appName=="Netscape";
t1=new Image();
t1.src="images/flower1.gif"
t2=new Image();
t2.src="images/flower2.gif"
function ner(){return true}
window.οnerrοr=ner
function pop(name){
i=document.cookie.indexOf(name+"=");
if(i!=-1){
i=document.cookie.indexOf("=",i)+1;
j=document.cookie.indexOf("#",i);
if(j!=-1)return document.cookie.substring(i,j)}}
function ps(name,value){document.cookie=name+"="+value+"#"}
if(!(ym=parseInt(pop("tsym"))))ym=0;if(!(y=parseInt(pop("tsy"))))y=0;if(!(xm=parseInt(pop("tsxm"))))xm=100;if(!(x=parseInt(pop("tsx"))))x=0;if(!(m=parseInt(pop("tsm"))))m=0;
function DM(){if(m)ps("tsm",--m);else ps("tsm",++m)}
function M(e){
if(n){
if(ns){
ts.left=x=e.pageX-xm;ts.top=y=e.pageY-ym
}else{
ts.left=x=document.body.scrollLeft+event.clientX-xm;ts.top=y=document.body.scrollTop+event.clientY-ym;event.returnValue=false}
}else{
if(ns){
xm=e.pageX;ym=e.pageY
}else{
xm=document.body.scrollLeft+event.clientX;ym=document.body.scrollTop+event.clientY}}}
function dd(){
if(ns){ps("tsx",x);ps("tsy",y)}
if(n){
if(ns){ps("tsxm",xm+x);ps("tsym",ym+y)}
}else{
if(ns){ps("tsxm",xm);ps("tsym",ym)}
st=xm-x;
if(st>60&&k<0){k=-k;document.t.src=t2.src}
if(st<40&&k>0){k=-k;document.t.src=t1.src}
if(!m){
if((st>120&&k>0)||(st
st=ym-y;
if(st>85)ts.top=y+=9;
if(st
function MD(e){
if(ns){
xm=e.pageX;ym=e.pageY
}else{
xm=document.body.scrollLeft+event.clientX;ym=document.body.scrollTop+event.clientY}
if(xmx+10&&ymy+10){
if(!ns){
if(event.button<2){xm=xm-x;ym=ym-y;n=1}
}else{
xm=xm-x;ym=ym-y;n=1;return false
}
}
}
function MU(){if(n){n=0;xm+=x;ym+=y}}
function cls(){ps("tsym",ym);ps("tsy",y);ps("tsxm",xm);ps("tsx",x)}
if(!ns)window.οnunlοad=cls;
if(ns)document.captureEvents(Event.DBLCLICK|Event.MOUSEDOWN|Event.MOUSEUP|Event.MOUSEMOVE);
document.οnmοusemοve=M;document.οnmοuseup=MU;document.οnmοusedοwn=MD;document.οndblclick=DM;
document.write("
var ts=(ns)?document.ts:document.all.ts.style;ts.left=x;ts.top=y;dd();setInterval("dd()",10)
本类相关信息
页面马赛克显示效果
页面左右分开
闪烁的表格边框
用单元格实现的七彩线条