网页之不断弹射的文字-特效
<style type="text/css">#supertext {
position:absolute;r4W4xg$sb$M
left:0;
top:0;'AW [K+C
visibility:hide;Si+rYR-S%cq.U
visibility:hidden;U5w!I.|!k7h[
}
</style>
<script language="JavaScript1.2">D"Q1g_-l;e CxW0ZK5B
<!-- 改变下的字体的大小。颜色-->
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'7`&j1mZ2w `o0j:V
var hidetimer='';
<!-- 改变下的弹跳速度-->w&Ee*V'q3T y
var BallSpeed = 20;%n0iQs9V1? h/f
var contentWidth;
var contentHeight;^j8H? N9WU
var maxBallSpeed = 50;
8V|O%p_F7V!Pz4p
var xMax;
var yMax;*y)?Ye&A}3W
var xPos = 0;
var yPos = 0;"U;ZK7z]Sf
var xDir = 'right';
var yDir = 'down';
var superballRunning = true;{1B+ePP3lh1p#d
var tempBallSpeed;
var currentBallSrc;{m&Fz2n~ N,{
var newXDir;gi_X1wy
var newYDir;
!\@'L:~a0t
function initializeBall() {
if (document.all) {
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";W'x u`3ODxTBU3v0B
contentWidth=supertext.offsetWidth
contentHeight=supertext.offsetHeight
}]v,yPyso3[;ki$K&V\
else if (document.layers) {t:X o+o*c5rd
xMax = window.innerWidth;
yMax = window.innerHeight;Sn`d] pnLf2U
contentWidth=document.supertext.document.width
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";
}
setTimeout('moveBall()',400);
if (hidetimer!='')5rw?W+J$PK
setTimeout("hidetext()",hidetimer)
}
function moveBall() {|;V-c:@/vR4k
if (superballRunning == true) {
calculatePosition();
if (document.all) {
document.all("supertext").style.left = xPos + document.body.scrollLeft;|u4z!I7q L|'_x
document.all("supertext").style.top = yPos + document.body.scrollTop;u$N$HSU
}bP/Ng4cW `
else if (document.layers) {
document.layers["supertext"].left = xPos + pageXOffset;
document.layers["supertext"].top = yPos + pageYOffset;{6EaqB b:q6I
}@.\6?c L^)u
animatetext=setTimeout('moveBall()',20);
}V-th.~/^5i1N
}
[CR&F7y v&a!n
function calculatePosition() {`?Ide6N7]\
if (xDir == "right") {
if (xPos > (xMax - contentWidth - BallSpeed)) {
xDir = "left";
}
}
else if (xDir == "left") {
if (xPos < (0 + BallSpeed)) {
xDir = "right";?m8m9z|EFgz;QU
}
}
if (yDir == "down") {
if (yPos > (yMax - contentHeight - BallSpeed)) {C6@:mu&o#IQ7P
yDir = "up";2H!L%[_4uR/l(k^
}*h2D,Hg.D2Ou$P
}c4s{K4s+n;e-u\
else if (yDir == "up") {3^#`-o!q+nb
if (yPos < (0 + BallSpeed)) {
yDir = "down";p F)LG:E$B9Wz4n
}
}
if (xDir == "right") {0] i8z)d J4~$m
xPos = xPos + BallSpeed;
}GE4E~J0p){O
else if (xDir == "left") { r*`a:e%q
xPos = xPos - BallSpeed;
}
else {
xPos = xPos;*UZk+}e4j+}~
}
if (yDir == "down") {&yb R)t|;q
yPos = yPos + BallSpeed;
} J)X-_\5Se8|
else if (yDir == "up") {
yPos = yPos - BallSpeed;
}7K&|8}e(y+c'b(s
else {
yPos = yPos;]I-O'Luj7z
}
}