网页之不断弹射的文字-特效
<style type="text/css">#supertext {
position:absolute;
left:0;#Vb"`B+ZL)t
top:0; uNkPd r0_
visibility:hide;
visibility:hidden;
}9t'OS"b)v|^'] I
</style>
<script language="JavaScript1.2">
<!-- 改变下的字体的大小。颜色-->8Gve(SdW['LM
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
var hidetimer='';
<!-- 改变下的弹跳速度-->
var BallSpeed = 20;
var contentWidth;9c2|Hz/X+H
var contentHeight;
var maxBallSpeed = 50;1o6e{4Rv
h:l:V;G6nr.}i(Zo
var xMax;
var yMax;3^!m `k[f+a Et3R
var xPos = 0;Rn"Unuq:p:x
var yPos = 0;
var xDir = 'right';A;wkK ns
var yDir = 'down';c1K _yo*{,Yo?:{
var superballRunning = true; Y"d:d)S"e
var tempBallSpeed;m S3cIkr
var currentBallSrc;
var newXDir;
var newYDir;$d8tS;Wb"p
function initializeBall() {KD*T5j@l&Ij9E
if (document.all) {FdUuG&{y/QG e
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";7o e w r o Gr
contentWidth=supertext.offsetWidth0]L x5VL2uR`v-e
contentHeight=supertext.offsetHeight
}
else if (document.layers) {
xMax = window.innerWidth;+Z*}"k#K%D6?^
yMax = window.innerHeight;
contentWidth=document.supertext.document.width2Z5\nNP4@)^
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";
}
setTimeout('moveBall()',400);
if (hidetimer!='')!}u"x.i#O5|'R])G
setTimeout("hidetext()",hidetimer)5r!Lj:fp#f.VZ
}
function moveBall() {
if (superballRunning == true) {)nP0zP;pLu(w)B~7H
calculatePosition();$ax,K qx
if (document.all) {GZu['q8[i&c8h
document.all("supertext").style.left = xPos + document.body.scrollLeft;m\/V&Va&d
document.all("supertext").style.top = yPos + document.body.scrollTop;
}-d3}|a^-o'^:Z
else if (document.layers) {Hy[L[@mC
document.layers["supertext"].left = xPos + pageXOffset; ])f0^ i2o7XX
document.layers["supertext"].top = yPos + pageYOffset;
}
animatetext=setTimeout('moveBall()',20); u0z%w{f4r0C3Xp
}
}
function calculatePosition() {
if (xDir == "right") {
if (xPos > (xMax - contentWidth - BallSpeed)) {8j D^F4];Il
xDir = "left";
}
} cpw7lmpw
else if (xDir == "left") {
if (xPos < (0 + BallSpeed)) {
xDir = "right";;z/b-t/i'Q:Y Hg4Y
}%W!H6dS s)C%t
}