网页之不断弹射的文字-特效
<style type="text/css">#supertext {GIEZ-u(TGV6E}4}
position:absolute;h;Q.o6uUz
left:0;
top:0;
visibility:hide;
visibility:hidden;__n^#{7^m#E,@
}soz#fYK&O9l[
</style>-k/Q7_pz:_;w
<script language="JavaScript1.2">$~(k"N%~q'p6aW
<!-- 改变下的字体的大小。颜色-->
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
var hidetimer='';+D+x X2G)eU ?
<!-- 改变下的弹跳速度-->
var BallSpeed = 20;
var contentWidth;
var contentHeight;
var maxBallSpeed = 50;S ~|!py_|7P3P z3`
{Gk3J7_ gq6g?
var xMax;
var yMax;
var xPos = 0;
var yPos = 0;+~0Rp6S)J't O6})B0d
var xDir = 'right';3p'C] A`J
var yDir = 'down';c p*RE+t[:S@L-Mr
var superballRunning = true;/m2Ph ts
var tempBallSpeed;
var currentBallSrc;
var newXDir;
var newYDir;zK-j-KU
n"CLK.gEf
function initializeBall() {#MnGq(gO;X I
if (document.all) {
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";M7z:~~M[j'i$}#M
contentWidth=supertext.offsetWidth
contentHeight=supertext.offsetHeight4m.Mr1uC }/Lix#z
}l/B(Kp!W
else if (document.layers) {8\HW)}*`[ B
xMax = window.innerWidth;
yMax = window.innerHeight;c_DdfvD/n$S
contentWidth=document.supertext.document.width.QV;^Tm
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";B(j s3n2j_
}
setTimeout('moveBall()',400);
if (hidetimer!='')
setTimeout("hidetext()",hidetimer)
}0E)xBp!A/n
7MzR o%O
function moveBall() {2mP5sT'kgp!S]
if (superballRunning == true) {
calculatePosition();
if (document.all) {2T-fP1L ya;_z7CM
document.all("supertext").style.left = xPos + document.body.scrollLeft;
document.all("supertext").style.top = yPos + document.body.scrollTop;t XX)p0r4k'@#Jq8g
}z6]r c/`?8M-o
else if (document.layers) {
document.layers["supertext"].left = xPos + pageXOffset;
document.layers["supertext"].top = yPos + pageYOffset;$e0? E)j1\
}8Nst}j`9y
animatetext=setTimeout('moveBall()',20);!K9Eo5z[,FP^
}
}
function calculatePosition() {
if (xDir == "right") {
if (xPos > (xMax - contentWidth - BallSpeed)) {:wER6p8i1|p
xDir = "left";
}
}7]8iR,hu!?{
else if (xDir == "left") {)]i!z(]:L.C-[n
if (xPos < (0 + BallSpeed)) {#B)n_5zyy.U'q
xDir = "right";
}
}rM3y(A`"C
if (yDir == "down") {pale/UHy-n:Q Yr
if (yPos > (yMax - contentHeight - BallSpeed)) {
yDir = "up";
}
}8M5V^6s"LF
else if (yDir == "up") {I/gU8H?+Rsr!k7K
if (yPos < (0 + BallSpeed)) {'u f&w7Te'Y,i`:]8s {
yDir = "down";
}
}(H(Ky&Q [%h
if (xDir == "right") {0S4R4TsrT
xPos = xPos + BallSpeed;
}.m8Wcfc0z
else if (xDir == "left") {
xPos = xPos - BallSpeed;
}
else {_k(F:kQ|d
xPos = xPos;
}
if (yDir == "down") {
yPos = yPos + BallSpeed;%mZXYS U/p7jA^
}
else if (yDir == "up") {#p [o+hWH:H[
yPos = yPos - BallSpeed;
}.e2e#w0myn{lm0V
else {&PV AL.I o#zN.po6L
yPos = yPos;
}
}Ly5~9L1}
function hidetext(){
if (document.all)
supertext.style.visibility="hidden"
else if (document.layers)
document.supertext.visibility="hide"
clearTimeout(animatetext)aI!F:_&}i
}
D|k+pd~
if (document.all||document.layers){
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')np-Rop1g&l,nQ
window.onload = initializeBall;
window.onresize = new Function("window.location.reload()");
};BL-ez a#h-B?
</script>
页:
[1]