网页之不断弹射的文字-特效
<style type="text/css">'D:l/r\l2s7mx#supertext {
position:absolute;
left:0;
top:0;!YO%h8bt
visibility:hide;
visibility:hidden;
}
</style>`#Gw6s;PtP
<script language="JavaScript1.2">7V-v Az%EM!h3Rh
<!-- 改变下的字体的大小。颜色-->
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
var hidetimer='';OOuM.Y{"Pv,e%mQ
<!-- 改变下的弹跳速度-->!hb+R6r"Tv
var BallSpeed = 20;
var contentWidth;Mk4\P8Nh Gg
var contentHeight;
var maxBallSpeed = 50;q9^ EW"F9ZD+ObL
var xMax;*K%Y)c9\4c#e"s
var yMax;[v\*\??[_
var xPos = 0;v#D { o4RF LH
var yPos = 0;
var xDir = 'right';:]@ dI4TQ
var yDir = 'down';
var superballRunning = true;,?Uy p%g3Byi fa
var tempBallSpeed;%](X\Uk3e5J;oL a
var currentBallSrc;
var newXDir; y#{Hb2b_
var newYDir;o/I*wd+MA
h9nF_4|/WN;}]/r
function initializeBall() {9jb6Nt?/m
if (document.all) {
xMax = document.body.clientWidthH@;Q tFBSZm
yMax = document.body.clientHeight*MW1O{/TZX
document.all("supertext").style.visibility = "visible";dKhwH4aK
contentWidth=supertext.offsetWidth
contentHeight=supertext.offsetHeight5?@q6W+O'^ p
}
else if (document.layers) {
xMax = window.innerWidth;qhY!s*H
yMax = window.innerHeight;Qm`8_J%Ax
contentWidth=document.supertext.document.width
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";
}v.O lU3c2a)P\
setTimeout('moveBall()',400);Eg2se#PI
if (hidetimer!='')
setTimeout("hidetext()",hidetimer)3\u Z/v^:W)h V&H
}
function moveBall() {
if (superballRunning == true) {6ts(y`9L'Fs(H
calculatePosition();R!O(U!ww0M3[7S B,y!]
if (document.all) {[(@P:lnw
document.all("supertext").style.left = xPos + document.body.scrollLeft;
document.all("supertext").style.top = yPos + document.body.scrollTop;u/IYsH+y;|
}
else if (document.layers) {&g8fm{*DHH} ?\
document.layers["supertext"].left = xPos + pageXOffset;
document.layers["supertext"].top = yPos + pageYOffset;
}tt#J C2@ SJ
animatetext=setTimeout('moveBall()',20);a)Rc M[:t
}
}+z6roD'~7jpI
/U}O%vld
function calculatePosition() {
if (xDir == "right") {6z4t"v ]s z#S7vyc
if (xPos > (xMax - contentWidth - BallSpeed)) {
xDir = "left";
}
}+n0K4jy.f$c%H.Vi
else if (xDir == "left") {0q)t5uVZ5n:p9ES[y
if (xPos < (0 + BallSpeed)) {!qmH7]F!O O'a x
xDir = "right";w~9PlpP F!PT
} t4|*p.J*Q o(a
}{;D;zN+}D:{"P@7x
if (yDir == "down") {6h3i6o.X b,N'Ev l
if (yPos > (yMax - contentHeight - BallSpeed)) {$B Z/jd[y4h
yDir = "up";tc\'].NV@,C }
}
}
else if (yDir == "up") {
if (yPos < (0 + BallSpeed)) {6n.B/K]&? u
yDir = "down";
}i)[(NQ-WDZv+l
}golDr YDJ
if (xDir == "right") {
xPos = xPos + BallSpeed;
}4G/vi6E8Nwo
else if (xDir == "left") {
xPos = xPos - BallSpeed;
}
else {
xPos = xPos;
}
if (yDir == "down") {8j4aEq0M5|
yPos = yPos + BallSpeed;5N~ w4u(XN e
}
else if (yDir == "up") {f^(W_{"u|-m*_)o
yPos = yPos - BallSpeed;R$t?!q~4A2j!BG8}
}y Fl$q'[$f+p4c
else {
yPos = yPos;3LKZt;_t8i$wG0BX
}
}]Q$S ?w%{9@Q
function hidetext(){)n&l.D*qa\T$E
if (document.all)
supertext.style.visibility="hidden"