网页之不断弹射的文字-特效
<style type="text/css">#supertext {&~hr&h mf7Itt)]US,U
position:absolute;fvt,o{5~
left:0;Y&qt B5{9}7q
top:0;F;Yl/S!L0G-u3M5b
visibility:hide;9NsTC%a K
visibility:hidden;
}x!q_/nf2Y
</style>oH4_Z%M
<script language="JavaScript1.2">4M/}li"w0Y"Wv
<!-- 改变下的字体的大小。颜色-->
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'&hny^R|5z/f d
var hidetimer='';
<!-- 改变下的弹跳速度-->J`.z1BKY6r^_!q
var BallSpeed = 20;0_x6x}5P7A.]9I}
var contentWidth;3zG'B/yKu'X#[w^f)Y
var contentHeight;.}tpm-kO @~+x
var maxBallSpeed = 50;y"j}:k,fB%e
%?[5^'WzA)Qj3Qx8a c
var xMax;D _)pJQ;_
var yMax;
var xPos = 0; e O$O BY+P
var yPos = 0;
var xDir = 'right';h-R0A"f8v(T3qO|n
var yDir = 'down';kkg_IW]w']Y1x
var superballRunning = true;"F+f @\%d#Z
var tempBallSpeed;1BeOo*v!U
var currentBallSrc;(Z:a Qk PTvD
var newXDir;
var newYDir;GIvu3Gs2y DN
function initializeBall() { dQ&h!l)~ G
if (document.all) {0y#b5bk#g
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";
contentWidth=supertext.offsetWidth
contentHeight=supertext.offsetHeight
}O7qt i}P1z
else if (document.layers) {
xMax = window.innerWidth;
yMax = window.innerHeight;
contentWidth=document.supertext.document.width kO@7oyW|:C Y
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";
}
setTimeout('moveBall()',400);u~)K Z Z
if (hidetimer!='')
setTimeout("hidetext()",hidetimer)
}6H%Qfs,|lI
function moveBall() {
if (superballRunning == true) {
calculatePosition();
if (document.all) {a\&\Fp)\
document.all("supertext").style.left = xPos + document.body.scrollLeft;
document.all("supertext").style.top = yPos + document.body.scrollTop;
}
else if (document.layers) {
document.layers["supertext"].left = xPos + pageXOffset;4@V+I(xmY%Y1[-U
document.layers["supertext"].top = yPos + pageYOffset; jaChgq'j T
}
animatetext=setTimeout('moveBall()',20);E`-[.CO![Gj
}
}
function calculatePosition() {
if (xDir == "right") {.f7iq"S"^[
if (xPos > (xMax - contentWidth - BallSpeed)) {Az;DI({X;O&w
xDir = "left";
}
}
else if (xDir == "left") {3?rDh4\5|,mJ} w F
if (xPos < (0 + BallSpeed)) {$T)U }/IPFA |
xDir = "right";XS3]Bz*XY(N `
} z!Kao2o `/qC
}
if (yDir == "down") {J.Z E'o1x%zM{8Q
if (yPos > (yMax - contentHeight - BallSpeed)) {
yDir = "up";
}1VggHs!M7H
}
else if (yDir == "up") {Io!nE6}+BG
if (yPos < (0 + BallSpeed)) {gT!X5L6c"Z7@
yDir = "down";
}up4^)@H%j#kNt
}
if (xDir == "right") {
xPos = xPos + BallSpeed;(Mf-?*Dp.W
}A*y1Zh5F,w ]:u
else if (xDir == "left") {!J+V2N}}5P9B
xPos = xPos - BallSpeed;.z"i M&E!bg"O
}2sa;EQW6l5{Q4z0zP
else {
xPos = xPos;yf8e$BNG"p#z
}
if (yDir == "down") {
yPos = yPos + BallSpeed;
}9Kc ku\*d8h`
else if (yDir == "up") {
yPos = yPos - BallSpeed;
}
else {
yPos = yPos;
}5l6e-R(k3ph)s
}~v&X0G#Yi0f/a"p
4V b}Vw:Ip
function hidetext(){Y]}c}!N+ED
if (document.all)["fhD?2j&i
supertext.style.visibility="hidden"
else if (document.layers)
document.supertext.visibility="hide"6o[ v8yz/]3KXK;A,z
clearTimeout(animatetext)
}
if (document.all||document.layers){9^pc {'p+BR
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
window.onload = initializeBall;"J*G_$Q8@\kOq
window.onresize = new Function("window.location.reload()");
}GTLo"vw*M
'w7g&s7mF){8X
</script>
页:
[1]