网页之不断弹射的文字-特效
<style type="text/css">;x"z*qY \1s;}#supertext {2qm!d e5dxQ,FY
position:absolute; ut!unyQ8NR6k
left:0;
top:0;
visibility:hide;PW`/GC Ecx
visibility:hidden; g-^"G4zj%H$z
}8i3st*z;K&x
</style>.BJ0B5Ui7D)^]
<script language="JavaScript1.2">z#\;I(A!B)l
<!-- 改变下的字体的大小。颜色-->H @!d M7sk"qTj:Y
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>' S#\$JS;{5Z
var hidetimer='';
<!-- 改变下的弹跳速度-->}"ggAA
var BallSpeed = 20;4mpXo8J~
var contentWidth;
var contentHeight;n'Wb,Cl5l f&us$h
var maxBallSpeed = 50;@}'gc+?^B
var xMax;m0}-YsUs
var yMax;
var xPos = 0;
var yPos = 0;;U$a i;oG4WBO;vVK
var xDir = 'right';
var yDir = 'down';
var superballRunning = true;!{ ]Ug5gj4B6Xb6jP
var tempBallSpeed;1rT2jfd5z/R&d{
var currentBallSrc;-O&R0k O1kI
var newXDir;*p{/z piH8PD.F
var newYDir;
YR t2V(_6^_X(A
function initializeBall() {
if (document.all) {
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";H)RcjRF*[
contentWidth=supertext.offsetWidthTB7z:i!o#vW
contentHeight=supertext.offsetHeighte S\.z {4MhF
}
else if (document.layers) {
xMax = window.innerWidth;$v`6S:w2U5Nt
yMax = window.innerHeight;o$z[AR
contentWidth=document.supertext.document.widthbFR lU3T`7H3dr
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show"; u N%jG |G&b
}
setTimeout('moveBall()',400);7@p(a!gw!D
if (hidetimer!='')O/bmrfTKA3o
setTimeout("hidetext()",hidetimer)
}
function moveBall() {
if (superballRunning == true) {kiI!PRw
calculatePosition();u'X;bx0m%_QRU0_
if (document.all) {.l|E0c H6`[
document.all("supertext").style.left = xPos + document.body.scrollLeft;
document.all("supertext").style.top = yPos + document.body.scrollTop;9JA2T0rol3jI
}
else if (document.layers) {4HEz)o$qV
document.layers["supertext"].left = xPos + pageXOffset;$NN w\ cO2Z7qq+F
document.layers["supertext"].top = yPos + pageYOffset;
}
animatetext=setTimeout('moveBall()',20);
}
}
9{Z$Fx,}Uc } E
function calculatePosition() {
if (xDir == "right") {LYc;T&jFZ8B
if (xPos > (xMax - contentWidth - BallSpeed)) {.mT%?? AD$~f
xDir = "left";
}.rM?7QAG^Q/~E
}
else if (xDir == "left") {
if (xPos < (0 + BallSpeed)) {
xDir = "right";Q uGV5H$U!}[+T
}
},FrUP{pC'lKkp
if (yDir == "down") {x m|gUQ
if (yPos > (yMax - contentHeight - BallSpeed)) {HL JW |?
yDir = "up";ZF5s'RL%OH,t"K9X
}:}g?eRv
}Su;IX*~\d:p
else if (yDir == "up") {Qu*Q^T
if (yPos < (0 + BallSpeed)) {)MiKt pL
yDir = "down";
}
} g[~)P'D:[@iO6dk
if (xDir == "right") {
xPos = xPos + BallSpeed;
}P'S&Fq'IA[e
else if (xDir == "left") {
xPos = xPos - BallSpeed;,jV qN,c&d
}JP,ddtm(i+pE,O
else {
xPos = xPos;
}
if (yDir == "down") {
yPos = yPos + BallSpeed;fg8{^Z6q
} q(qH ]P4Ai ~*v w
else if (yDir == "up") {7n.rQ@8C1?C
yPos = yPos - BallSpeed;/fuS.ikfR'TY[
}
else {"{8CeJ&[8^
yPos = yPos;
}&Z Ia7ApZ` B)[]'I*z
}
function hidetext(){$Ov,NF!w
if (document.all)8q%LY5{!`:z
supertext.style.visibility="hidden"/?6E(akhj.h G#`
else if (document.layers)
document.supertext.visibility="hide"
clearTimeout(animatetext)
}P*_|*w~*r%`q-C
6?$Qyx[/^@n
if (document.all||document.layers){zi#WB!r0[5Dw2X
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')|R U[IF'D z
window.onload = initializeBall;
window.onresize = new Function("window.location.reload()");W1Qyl'SlH j ~
}
</script>
页:
[1]