捌玖网络工作室's Archiver

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

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

<style type="text/css">
zu-l8Q0{5^T Ka #supertext {
yP)].l2gDXh O position:absolute;2fEX I D;l&`LW
left:0;
h,L]"He u t5g top:0;
#R9?W/Z9Qe _ visibility:hide;
3lKg3y0t)ZEh,a visibility:hidden;6z4cO0xo%t5Q'} dR*z*E
}C&i:_R(A"k{%Ju
</style>,JR%W Qm8p$A$G#p+u
<script language="JavaScript1.2">
)O2t F E[ <!-- 改变下的字体的大小。颜色-->t;o w5oU6w
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
&Z'Ij:g&L9xj var hidetimer='';P?/Ew(^RDl
<!-- 改变下的弹跳速度-->
/uS3[e X0Z)DK var BallSpeed = 20;3c9IF X;Ku[UUo
var contentWidth;i4Y-A*z#JQ @
var contentHeight;R-GF2q:D)s
var maxBallSpeed = 50;
_{y6ZD2RS &E6Q-j L^[Y-^,}
O u9S/QC ]M/O
var xMax;{p;a*l En
var yMax;
(G@z8gQ*f!_ var xPos = 0;
lH0P~ywN var yPos = 0;
0e1~"FV)h2B)kg/L var xDir = 'right';
`j&Lr HT.LP7}8o var yDir = 'down'; g ^ eY|y;T ]i
var superballRunning = true; K?qT^u
var tempBallSpeed;
7~NG:G1f~f var currentBallSrc;
i9{7ix](N var newXDir;;uK ?^&H
var newYDir;#v{(Ap#{T mfc:[

Rd T,D Mk4} function initializeBall() {xa d0qO.OiL E
   if (document.all) {
0R'I D;L P"WV eIR)L       xMax = document.body.clientWidthM d,o%?*uy e:?fs%{
      yMax = document.body.clientHeight
$g-N%p+~q+Xc{-Q       document.all("supertext").style.visibility = "visible";:_B*B1a"g NA+Y+S&m V
      contentWidth=supertext.offsetWidth
wM YRL Ki#W       contentHeight=supertext.offsetHeight8X8].x#B V VG"G%j
      }
Omd"G zC^:P7T%Y/B    else if (document.layers) {t:wm.p*kSX
      xMax = window.innerWidth;
!Y+e h.^A:QMD       yMax = window.innerHeight;(Py*SA(u:zA B
      contentWidth=document.supertext.document.widthwe)ZW3A ~0L
      contentHeight=document.supertext.document.height
-bD&n7YC       document.layers["supertext"].visibility = "show";
\"{:|z6v,p1f       }2F;@`,@uDm9{L
   setTimeout('moveBall()',400); d5E&V4g#y,FYY3]0m
   if (hidetimer!='')
QZ?-r;Fm@'@,N;t    setTimeout("hidetext()",hidetimer) r4I oeI~
   }+r7p2J ]} ?

)Dm%u,x3q4]Z function moveBall() {_k!h1o4Uq3F
   if (superballRunning == true) {v,RX,WDMwhK
      calculatePosition();
XE8tK)rM*HN-gw       if (document.all) {
iL+@ WjW#?+i          document.all("supertext").style.left = xPos + document.body.scrollLeft;!y ^O ]2D2^
         document.all("supertext").style.top = yPos + document.body.scrollTop;
|/\0pm5}          }b"?1d.x7q'}
      else if (document.layers) {
&oJ+`7nd.T          document.layers["supertext"].left = xPos + pageXOffset;
z D+Q \.hv          document.layers["supertext"].top = yPos + pageYOffset;H_#M Z0p+i Dq
         }
hqS}[(d,nZ5buW       animatetext=setTimeout('moveBall()',20);
7O*x]X7E"q~xL       } j b/E,?5y Wf
   }
6C"w3g&]1{t!pD
u+F$A6t}'? function calculatePosition() {z;A*SQ-hK5l8~9Pl
   if (xDir == "right") {
4M[7? Nd)RCp       if (xPos > (xMax - contentWidth - BallSpeed)) {
d4h.M2V7zH          xDir = "left";&U(R v w.KC{
         }p x;yb'M H]Le
      }
P7w.Pa^I6i-n4U    else if (xDir == "left") {]6K%S,e2r/J8aopwK
      if (xPos < (0 + BallSpeed)) {
QPqW{eQ R*g          xDir = "right";N~#H2p4nF)TW
         }
3L&Ub[k+R wqi       }m#Zq,]7n
   if (yDir == "down") {
nkz&kQM+w3p(^       if (yPos > (yMax - contentHeight - BallSpeed)) {}e/O'RHu6|$l9}
         yDir = "up";(q"yFF`P-o
         }
Mmf4^+M+e       }fKx0IZ@M
   else if (yDir == "up") {1W|;xa%T-Mbn
      if (yPos < (0 + BallSpeed)) {
A)d7B&RK6f          yDir = "down";N@*O[MF
         }
5m6DK?"s       }7`~#u`s:}%Gn
   if (xDir == "right") {
ZrR.k `VL7kw*p       xPos = xPos + BallSpeed;
^2~ S!e/~ qC8H       }G'lS B)yS J:Q7X!D y*b[
   else if (xDir == "left") {
\;wF)D:n&UQ)P$u       xPos = xPos - BallSpeed; o.a8}.BP3lSWEjx&g
      }
T^/Z8S4S)d-?!`;~&u    else {
k%fHJR"]_(u       xPos = xPos;
0h6T$|c'Y9N w       }
pzX6a;z^'T@    if (yDir == "down") {
|NCM!h7cv"S       yPos = yPos + BallSpeed;
4q,t,id|\*D Eo$@j       }r$HO ? C mO
   else if (yDir == "up") {
b#@DqGL L&{6y(\6S       yPos = yPos - BallSpeed;
$SLe#}eNO       }6imT6d9PZ
   else {
:B*X#FK8sp TL x N       yPos = yPos;p:AWYo3E0E:A$Nx'\
      }8~IxB'U3e-L.j0[C
   }
ay,aS(z!r#]YZ(c
FS UK I function hidetext(){*Q4[yf!i-I
if (document.all)"vZ7f$R9R PIP+D
supertext.style.visibility="hidden"
dO g6`%@^-i else if (document.layers)
!f9G+b$pf;hi,urye-n document.supertext.visibility="hide" l0U Db5\1a@
clearTimeout(animatetext)2b,wq$U r p;w'|2r
}/q-xe Bw"~4O;N

iVa`PM c if (document.all||document.layers){,t o?)oi_+S v
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
w!K0P4h QyC5o b window.onload = initializeBall;
.hk0?7VR$N~7K window.onresize = new Function("window.location.reload()");
wN"uy/[(z9KeAf } OlxZ$`YnJc"^._

(oBW4v&{[{ </script>

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


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