网页之不断弹射的文字-特效
<style type="text/css">]j0ab"d ?#supertext {4z4O4]BZvBW3|
position:absolute;
left:0;:l Y W,Z ^;KA*P$HB,SY
top:0;
visibility:hide;/KZ kT5}Y4{[mic
visibility:hidden;-cX k` B^8~
}
</style>
<script language="JavaScript1.2"> nD9P.`!v9`'M(|X9Zu/R9l
<!-- 改变下的字体的大小。颜色-->?Ld7wKTa'f\
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
var hidetimer='';%pfJ/HqZw
<!-- 改变下的弹跳速度-->
var BallSpeed = 20;/ui {g6x(c
var contentWidth;!pt'MDR'm9qf${ c
var contentHeight;
var maxBallSpeed = 50;
#dx,~ yQ [3Z W/h#i
var xMax;
var yMax;
var xPos = 0;BX3b.K4p&o
var yPos = 0;^ _6z/I!Foe9wcfCv
var xDir = 'right';
var yDir = 'down';
var superballRunning = true;
var tempBallSpeed;
var currentBallSrc;1h z`r EN&l:`
var newXDir;KO]+`4Y6R%U9F&~
var newYDir;rbI }/|nY!T
w,\6?@ GJ%dxz+e8H]4V3O
function initializeBall() {(__c-~:y.Cu
if (document.all) {Y"C0Op/E`z
xMax = document.body.clientWidthS:B8D0x k~`
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";
contentWidth=supertext.offsetWidth+V:Oh*q7G&mC
contentHeight=supertext.offsetHeight
}
else if (document.layers) {{6O:v|^!xi
xMax = window.innerWidth;
yMax = window.innerHeight;2L7qq;_9X+D_
contentWidth=document.supertext.document.width/~9z'? Z*Y
contentHeight=document.supertext.document.height }3x"[;rV,Z'A
document.layers["supertext"].visibility = "show";
}`1D@+C:r9Rz
setTimeout('moveBall()',400); MFT(oR&o'A
if (hidetimer!='')zD Y(\q
setTimeout("hidetext()",hidetimer)s(y zc2L/]
}]IM#PK)X
'A!a2tED`-]
function moveBall() {
if (superballRunning == true) {
calculatePosition();
if (document.all) {_&c?eAHnSI5TA
document.all("supertext").style.left = xPos + document.body.scrollLeft;"Y U7E&Q0N/O)wpi
document.all("supertext").style.top = yPos + document.body.scrollTop;
}TY+^!\jg
else if (document.layers) {t,rM{l$k^ZA q
document.layers["supertext"].left = xPos + pageXOffset;
document.layers["supertext"].top = yPos + pageYOffset;
}gu'I ^\,f%x
animatetext=setTimeout('moveBall()',20);#h |[g7yD4S3e6p
}N*elpK_UO)K
}
function calculatePosition() {j%f vE p&Yk-@M
if (xDir == "right") {$ny.I(Kv:`#v
if (xPos > (xMax - contentWidth - BallSpeed)) {B$@c,Xu v
xDir = "left";'xU9]C)K{&i
}5U0Lh&I*h@m
}7ndr^jR9N%v$CG
else if (xDir == "left") {
if (xPos < (0 + BallSpeed)) {
xDir = "right";#o+b&u7{+uBseq
}i*D[6_Ky@
}
if (yDir == "down") {
if (yPos > (yMax - contentHeight - BallSpeed)) {
yDir = "up";
};qu4TLXk
}P M|TWyu
else if (yDir == "up") {
if (yPos < (0 + BallSpeed)) {[R!| U'l$J:C?U$?
yDir = "down";
}'uX8Li T/F@
}? XD0M]]/O
if (xDir == "right") {
xPos = xPos + BallSpeed;