网页之不断弹射的文字-特效
<style type="text/css">)h ZS/X CW~c~#supertext {,a5X;?9El^%jKxWw
position:absolute;+^+x.cY@b fw
left:0;
top:0;
visibility:hide;a+RD[3]-@1T[z7B
visibility:hidden;
}
</style>WD*L1[1H
<script language="JavaScript1.2">
<!-- 改变下的字体的大小。颜色-->
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'%b5\sDC3a
var hidetimer='';
<!-- 改变下的弹跳速度-->u2{x'AUX/{{0q
var BallSpeed = 20;
var contentWidth;}\Z:`%{ulM#V$q
var contentHeight;
var maxBallSpeed = 50;h`y F;i%fMh
0@x,Le!g,`(@lR
var xMax;2V,Xd5MF|-B
var yMax;
var xPos = 0;
var yPos = 0;
var xDir = 'right';4y'E8c dc!m@ i
var yDir = 'down';vCVw%N["?pg.S
var superballRunning = true;p9I;heV"|a2GOPt
var tempBallSpeed;`6aS$ZFr+W D3fd
var currentBallSrc;
var newXDir;/K"T~GD;a
var newYDir;
function initializeBall() {
if (document.all) {
xMax = document.body.clientWidthl{;G J/y1Wd3I#yYkp
yMax = document.body.clientHeightS1l @(Qn.A
document.all("supertext").style.visibility = "visible";
contentWidth=supertext.offsetWidth,mD)lK&M
contentHeight=supertext.offsetHeightX/L8cO} Ev1ve
}'Aol};?ay}
else if (document.layers) {
xMax = window.innerWidth;
yMax = window.innerHeight;
contentWidth=document.supertext.document.widthkVD&Qi5e U-~\
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";
}\"nX.k;S;jg$p
setTimeout('moveBall()',400);
if (hidetimer!='').euS oT-zT*_ ~;h])g
setTimeout("hidetext()",hidetimer))\`V Ra+o `Q
}|1|,Q4}^gv
function moveBall() {RO/wL'[\/l3mii
if (superballRunning == true) {bR$f/X4WR,e
calculatePosition();Pl'B0g7JT
if (document.all) {u,AM)s'K3m9h
document.all("supertext").style.left = xPos + document.body.scrollLeft;K\BL*G!}:a ?
document.all("supertext").style.top = yPos + document.body.scrollTop;
}ih'isM,YS6N
else if (document.layers) {
document.layers["supertext"].left = xPos + pageXOffset;M-MLw?
document.layers["supertext"].top = yPos + pageYOffset;
}
animatetext=setTimeout('moveBall()',20);
}'Q+O){Y&iPY4{
}
5N(d1Rl S'R1o:|_6y
function calculatePosition() {
if (xDir == "right") {
if (xPos > (xMax - contentWidth - BallSpeed)) {
xDir = "left";Vm%p%\9vpR,k.o'G
}!PIH u(^
}iF t0r,PE
else if (xDir == "left") {
if (xPos < (0 + BallSpeed)) {
xDir = "right";d bm2R.p
}9Vs+NyU
}
if (yDir == "down") {6mo{[ nU~Ib V4\
if (yPos > (yMax - contentHeight - BallSpeed)) {
yDir = "up";
}
}
else if (yDir == "up") { q|'C+@Ftg
if (yPos < (0 + BallSpeed)) {
yDir = "down";pWq?7V
}
}
if (xDir == "right") {
xPos = xPos + BallSpeed;8^N6a(`a:D0FWG"z
}
else if (xDir == "left") {1G%^J!bg)~i$]
xPos = xPos - BallSpeed;.hy"^2v-hBD8a
}
else {+b!E`H bOg
xPos = xPos;q(ZF,KfM(E*kp
}
if (yDir == "down") {JT,BN1I`aO
yPos = yPos + BallSpeed;]/znARPY
}