捌玖网络工作室's Archiver

zw2004 发表于 2008-1-21 20:55

网页之不断弹射的文字-特效

<style type="text/css">s~@*ET G0gq,L7}@
#supertext {
I#s@Dw `F }$N position:absolute;
,[6~F1z }i p left:0;QH]2Y@+k~^
top:0;
G%}6mh5o visibility:hide;
"XLWDR o visibility:hidden;dD%Vf5q2C,V)ga
}V1G DQ,@
</style>
C)l;C&Lxgg <script language="JavaScript1.2">PR%T X;y
<!-- 改变下的字体的大小。颜色-->&x9KkgK `KI
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
_ ^o]8s var hidetimer='';
,P1}k {P;ND <!-- 改变下的弹跳速度-->
`#Xh.i1z di var BallSpeed = 20;ZN ?N;`,C3I(x;oa
var contentWidth;
rmq}_| var contentHeight;l!e\\KR2fw7c
var maxBallSpeed = 50;%G%G:dU}*oVVI2q
X;F0Dyn't%m+U:G

bb4q8` W7Nm+n dI var xMax;
(@\ |{f:~cfl var yMax;
T0G1UM8L var xPos = 0;%E d!~%dd
var yPos = 0;
rjI!~{4E"q"Nv \ var xDir = 'right';
9k4B[f;Zl*ElE"X var yDir = 'down';v9h?b Z.Z2^'Z7UgY
var superballRunning = true;
s4j,Aye"Nv8[|*[ var tempBallSpeed;Qa*S,c+B I1h3NJ Omew
var currentBallSrc;
!c;?AS1e4{8{3l var newXDir;
"@`9A~ h"k W7J?2p var newYDir; \n|[]/W$f[
W!y8d&x(M];j
function initializeBall() {K"c-zQ4T uC
   if (document.all) { Vs4\6gk)@4M6k
      xMax = document.body.clientWidth
K U^JPR       yMax = document.body.clientHeight
;D%Kh!s?&g%tfp       document.all("supertext").style.visibility = "visible";9p@-[N0h^
      contentWidth=supertext.offsetWidth-WiC9~a4N@R;~
      contentHeight=supertext.offsetHeightZ2bps*Vmy&EE
      }D:^#T,bjY
   else if (document.layers) {
%dy;V0xm+UZ/dC I0o       xMax = window.innerWidth;9I1ol0?i!N'Xk
      yMax = window.innerHeight;
c8j.dt%zuf       contentWidth=document.supertext.document.width*bXlO W D5aE/x'V
      contentHeight=document.supertext.document.height
z}g"~ r1|       document.layers["supertext"].visibility = "show";
`im8[Z1XU       }
oX j]G&D2cCs    setTimeout('moveBall()',400);OkK W w.D
   if (hidetimer!='')
/yT7u}9V {d)J.N    setTimeout("hidetext()",hidetimer)0ii,O'Y%? m4B
   }
;{ V@\2L5|%a kg
L E4I&j;D,| Gl function moveBall() {}jyD+{5l5Zj Sqo
   if (superballRunning == true) {*Sqj$GX
      calculatePosition();
\ mzc#S       if (document.all) {F6^9?Pz,v x
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
Y.K'W#S+EL{n          document.all("supertext").style.top = yPos + document.body.scrollTop;._%b%z'^NkEMV
         }
&qUd:_$I8q$Q       else if (document.layers) { Y3u#pq!D R@;N
         document.layers["supertext"].left = xPos + pageXOffset;%GPay#R
         document.layers["supertext"].top = yPos + pageYOffset;
:~|7k"n5vco.R          }
A1p%ai1X;}'U8S"]       animatetext=setTimeout('moveBall()',20);H*t6MhP*Z,K
      }8K{km;~$j2Q(Op$m
   }
|2e!_-{ g,k~Z x6neL$R"C`
function calculatePosition() {*k&`g?&o7^2WXB
   if (xDir == "right") {/vm&hCd(TU'D@a
      if (xPos > (xMax - contentWidth - BallSpeed)) {
(M8V"vZ Zp\/o          xDir = "left";
O"u-bO:Q a          }y6`3Xk%\.Kka)Kg
      }
h`U9b[ q@    else if (xDir == "left") {Y(az-l&\P]E#l
      if (xPos < (0 + BallSpeed)) {"^!V!p$Q#qL0} s
         xDir = "right";
K4_t6RZ@$^T          }P6t$u%F+ri&\6_E
      })k9z:UG@{u
   if (yDir == "down") {
x%nv$I? U7}       if (yPos > (yMax - contentHeight - BallSpeed)) {,z|/_4u^qp
         yDir = "up";6x%K9`GF0Z}
         }
S_G"g FZ       }
k,\)`Cz0w    else if (yDir == "up") {2sZ5aJ"Vr tz
      if (yPos < (0 + BallSpeed)) {
%v"D R M4`zV          yDir = "down"; q&f(f yY%W.@v#u
         }
6F^[%G$G ~9Lt)d       }
Y5S%GoUL    if (xDir == "right") {
,X5fWu:?       xPos = xPos + BallSpeed; JU)D3iX F
      }v]f8s-i#nV ?
   else if (xDir == "left") {m4X]k v
      xPos = xPos - BallSpeed;Ew2]9u3~p%w'i%g
      }
%}Z"}8QH;[ Q    else {n:`rV V(CVE {_
      xPos = xPos;
I3Z| `x-Vg       }ED z v^8} ?
   if (yDir == "down") {GJ1mS)n)Vm5n)V
      yPos = yPos + BallSpeed;
)v Q]+ShN`       }
4b Q"r%K H8mSr V:O    else if (yDir == "up") {+i!{G4X-N6v
      yPos = yPos - BallSpeed;r:y!zAWr&j
      }
*\1t9b:h ta8C    else {h!{+S"P"j%J.J%D
      yPos = yPos;
]8AYi2o!Qz^       } ? cg`x!t7l
   }
Ou%Xj)yVcs )wo#u6it*n$T,R
function hidetext(){
_L7@yIp'y2k if (document.all) c n8e'uQ|(yZsM3v]
supertext.style.visibility="hidden"
-h ~/T s0@r-NO else if (document.layers)`!u7L&zu*U&Y5h
document.supertext.visibility="hide"
`R6\2KnK3R clearTimeout(animatetext)!~-m"HrKza0Z2R
}V0v7s^bz(^j

+NP;VPEo if (document.all||document.layers){2o}.g6@gN
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')*BLxL-U`
window.onload = initializeBall;
1t k3cLSC window.onresize = new Function("window.location.reload()");
H/X Fn&z8nrP\ }-|0u@a J4t xC
oC_p1b
</script>

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.