捌玖网络工作室's Archiver

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

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

<style type="text/css">
nK4C%Hs6u #supertext {0~"W5Rl:] I
position:absolute;dcH[ o2aq)pE
left:0;f5dL#d$h$y+]\6f9\r
top:0;
#hEJH'PW visibility:hide;7?c?|1C
visibility:hidden; X.o"l+ww!rP+z`)Sd9J
}
MczuN$w+u </style>
9X%TM3ZD7H]L.Q <script language="JavaScript1.2">
0g \&t3jhb/lX <!-- 改变下的字体的大小。颜色-->
)kB;]l#Go?g2V var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>';x4a Abb
var hidetimer='';#gNV[*W.w
<!-- 改变下的弹跳速度-->
+o V9FCP4m$V0x \b var BallSpeed = 20;
9\T PM\e]4mZ var contentWidth;#Q2B a W#V#Ow\2q
var contentHeight;
Src;PC var maxBallSpeed = 50;
,F5P1]Y y _)n {yw5\

I\rxMud6[ l*`2YK var xMax;'bu3m yZtqd
var yMax;
'm xW]3V var xPos = 0;.b9tbf(~!A:t
var yPos = 0;
xN:y3FC7i K!hh var xDir = 'right';
V,j ne"sM@#^:^ var yDir = 'down';A+hm6y7|yi
var superballRunning = true;`6z&P%v{l0f
var tempBallSpeed;!WzhBj5t S.q
var currentBallSrc;8Q J(q9tT }2Q
var newXDir;
Y4I$RFj var newYDir;
'@$B-X cd l7} Rd
a!X d,x%S function initializeBall() { g `"Qm`-Y"n"p
   if (document.all) { \Z#r*~*j}QZj.y
      xMax = document.body.clientWidthv2j^'W&|xup!l)N
      yMax = document.body.clientHeighthv8Y/W_pA
      document.all("supertext").style.visibility = "visible";-`Y p:Y&M#`}$kW }
      contentWidth=supertext.offsetWidthjx\)H;q
      contentHeight=supertext.offsetHeight
d#y*D"d g$x yo(qE4V       }
m)fZ ].Z)F$_6EQ    else if (document.layers) {
:zHG\#d^@ e9L       xMax = window.innerWidth;\*@^+C Y
      yMax = window.innerHeight;
9@+uy FoA(D       contentWidth=document.supertext.document.width
h/CY.}%H j e       contentHeight=document.supertext.document.height:J9H$T^+KE
      document.layers["supertext"].visibility = "show";
C I&C8s"L)d.wx] VO       }
FQ7mc[:v3gb    setTimeout('moveBall()',400);
*['Y8A`a0Z    if (hidetimer!='')
@`Dy1t,af k!@dH    setTimeout("hidetext()",hidetimer)
!n/D(tv5yb'K9i"Jn    }^$YV+e|I\_

7qDU `(p C function moveBall() {
A7l-z5EK{    if (superballRunning == true) {6v@]{MV;t!_
      calculatePosition();
^ T*Wl$nH$h,U p       if (document.all) {
k2S({h/OX          document.all("supertext").style.left = xPos + document.body.scrollLeft;
)~,V,b|D1uF#i          document.all("supertext").style.top = yPos + document.body.scrollTop;)^/x#i W9` m^"O
         }"J$s0G1E9{1h
      else if (document.layers) {
{} xn v6E)E!nzN          document.layers["supertext"].left = xPos + pageXOffset;
K(d(U-Ge+HE          document.layers["supertext"].top = yPos + pageYOffset;
2Cso o6u1U&R5e          } ]'Pw1RG(w7v)[
      animatetext=setTimeout('moveBall()',20);
E*h,Ltj M sY       }
'rs GB(S}U    }I)C$ZZsU
?pD-H.C}
function calculatePosition() {
ZXP\ E%u    if (xDir == "right") {
a-lI8]3e5E.b       if (xPos > (xMax - contentWidth - BallSpeed)) {L"^Bs3I7AW
         xDir = "left";
WDO izj/jI T.K9E          }
ITl8]y|h/[       }png1A1w.Sa
   else if (xDir == "left") { Pj)fO\W9ns,@5K
      if (xPos < (0 + BallSpeed)) {po e.d N1w2^*FH oMgo
         xDir = "right";
5G%M@ Aa]          }6NJ G;cw%q
      }
:xf9J5E(T    if (yDir == "down") {9TE3l/\p0u-Yi
      if (yPos > (yMax - contentHeight - BallSpeed)) {
ON4h8S&Id8Z L@[          yDir = "up";
N$Xa_FS          }#S&s9?q!E
      }/Q;O.esjcmO
   else if (yDir == "up") {
!R Z@MUFD^/w       if (yPos < (0 + BallSpeed)) {
P4U|/B.e{6y          yDir = "down";a(M]:Vj+gj
         }
D e:pk?]9a       }1Kr},Fr Wu%E"o
   if (xDir == "right") {w,Uh'T;]/~iJ
      xPos = xPos + BallSpeed;2`.bOd,I;s8IQ/Sw
      }
D/J-E'r0tu k4FO~    else if (xDir == "left") {
!r2e4QA0Oai       xPos = xPos - BallSpeed;m|/JA&U sL:|,h,T
      }
gU PHMLyF    else {n'Dlwpe g:}
      xPos = xPos;.i6?p`}
      } _ nA1Q(z&N
   if (yDir == "down") {
$O#Hzh#sY8^6Ly       yPos = yPos + BallSpeed;
B["I Y2J/T2mn?-a       }
bJv#L+C9lD    else if (yDir == "up") {!On3e*M(_eT|
      yPos = yPos - BallSpeed;
J_Lw+I       }
.|3~I ]7E    else {
|*nQR8E       yPos = yPos;|&d#?_9e+W-}!d2b:}&f
      }9U`IS^#P*W%W
   }
U6B9v a @` c$^/MA.l4c7?i
function hidetext(){iV h fRH&s6L#H`2B
if (document.all)s AkR b2{[-Ga!`
supertext.style.visibility="hidden"
"IB6^q-s |@S;{#l-Rl else if (document.layers)AS~$J\|_ b%B
document.supertext.visibility="hide"
`&\}bYKx;v~? clearTimeout(animatetext)!QKQ&z4o8~)rw
}
;HLo `)Zx Wvw7D
m#Ha!? sq1a l if (document.all||document.layers){x2[ O o5j
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
6x[nt4XE4G window.onload = initializeBall;j4H VN`q M t
window.onresize = new Function("window.location.reload()");o"VaB0r7}4g3]+_)]
}2IM[bi!W)Uz%G+U
oP;JXXxr
</script>

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


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