网页特效代码.docx
- 文档编号:7167635
- 上传时间:2023-01-21
- 格式:DOCX
- 页数:67
- 大小:33.85KB
网页特效代码.docx
《网页特效代码.docx》由会员分享,可在线阅读,更多相关《网页特效代码.docx(67页珍藏版)》请在冰豆网上搜索。
网页特效代码
--
body{font-family:
"宋体";font-size:
9pt;margin-top:
0px;margin-left:
4px;margin-right:
0px}
A{COLOR:
black;FONT-SIZE:
13px;FONT-WEIGHT:
400;TEXT-DECORATION:
none}
A:
hover{COLOR:
red;FONT-SIZE:
13px;FONT-WEIGHT:
400;TEXT-DECORATION:
underline}
a:
active{font:
9pt"宋体";cursor:
hand;color:
#FF0033}
-->
.star{
position:
absolute;
layer-background-color:
white;
visibility:
visible;
top:
-50px;
width:
50px;
height:
50px;
font-size:
1px;
background-color:
white;
}
--Begin
varstarnum=75;//Numberofstars
varisNS=(document.layers);
var_all=(isNS)?
'':
'all.';
var_style=(isNS)?
'':
'.style';
varxoffset,yoffset,w_x,w_y,tmpx,tmpy,scrlx,scrly;
functiongetstartpos(obj){
obj.deltay=Math.floor(Math.random()*12);
obj.deltax=Math.floor(Math.random()*12);
obj.xdir=(Math.floor(Math.random()*2)==1)?
'+':
'-';
obj.ydir=(Math.floor(Math.random()*2)==1)?
'+':
'-';
obj.counter=1;
if(isNS){
obj.clip.width=1;
obj.clip.height=1;
obj.moveTo(xoffset+pageXOffset,yoffset+pageYOffset);
}else{
obj.width=1;
obj.height=1;
obj.pixelTop=yoffset+document.body.scrollTop;
obj.pixelLeft=xoffset+document.body.scrollLeft;
}
}
functionmovestar(starN){
tmpx=starN.deltax*starN.counter+starN.counter;
tmpy=starN.deltay*starN.counter+starN.counter;
if(isNS){
starN.clip.width=starN.counter/3;
starN.clip.height=starN.counter/3;
scrlx=pageXOffset;
scrly=pageYOffset;
if((starN.left+tmpx>=w_x+scrlx)||(starN.top+tmpy>=w_y+scrly)||(starN.left-tmpx<=scrlx)||(starN.top-tmpy<=scrly)){
getstartpos(starN);
}else{
eval('starN.moveBy('+starN.xdir+tmpx+','+starN.ydir+tmpy+')');
}
}else{
starN.width=starN.counter/3;
starN.height=starN.counter/3;
scrlx=document.body.scrollLeft;
scrly=document.body.scrollTop;
if((starN.pixelLeft+tmpx>=w_x+scrlx)||(starN.pixelTop+tmpy>=w_y+scrly)||(starN.pixelLeft-tmpx<=scrlx)||(starN.pixelTop-tmpy<=scrly)){
getstartpos(starN);
}else{
eval('starN.pixelTop'+starN.ydir+'=tmpy');
eval('starN.pixelLeft'+starN.xdir+'=tmpx');
}
}
starN.counter++;
}
functionanimate(){
for(i=1;i<=starnum;i++){
movestar(eval('star'+i));
}
setTimeout('animate()',100);
}
functionfindwindowparams(){
w_x=(isNS)?
window.innerWidth:
document.body.clientWidth;
w_y=(isNS)?
window.innerHeight:
document.body.clientHeight;
xoffset=w_x/2;
yoffset=w_y/2;
for(i=1;i<=starnum;i++){
getstartpos(eval('star'+i));
}
}
functionresizeNS(){
setTimeout('document.location.reload()',400);
}
(isNS)?
window.onresize=resizeNS:
window.onresize=findwindowparams;
window.onload=newFunction("findwindowparams();animate();");
//End-->
--Begin
for(i=1;i<=starnum;i++){
document.writeln('
eval('varstar'+i+'=document.'+_all+'star'+i+_style);
}
//End-->
--hide
functiongoHist(a)
{
history.go(a);
}
//-->
-- google_ad_client="ca-pub-4346681031078947"; /*728x90,创建于07-11-18*/ google_ad_slot="1163201327"; google_ad_width=728; google_ad_height=90; //--> src="