捌玖网络工作室's Archiver

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

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

<style type="text/css">3f#~7^'I,h&ZR
#supertext {
;x5b-EVaSk@ position:absolute;
@owG AvJ left:0; T c)~ Y$y,R-|Z
top:0;
q'} b5H(U(U x*r*w visibility:hide;R ^'u[M(c
visibility:hidden;gUU5OW!f,z
}
#T S5ee_,ji </style>
t(L y E|\&O5Ju <script language="JavaScript1.2">8I z9?P.L&X B$|
<!-- 改变下的字体的大小。颜色-->
{5YExP^ var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'M.t"ll t+Cs
var hidetimer='';YA#J$CC\l!V
<!-- 改变下的弹跳速度-->"C R O5u u
var BallSpeed = 20;c`8tE&qY4n2_0WR
var contentWidth;k"B:[mfy@
var contentHeight;o j qV!\1x
var maxBallSpeed = 50;
/G EX I wg.h0w Kk9G hnr IlN6A"y+i*`

7i~MTl A,Zu var xMax;
!Xm5o"b:q(Q#s UR var yMax; rH1f |Jn
var xPos = 0;
O9{Xa8fK \q var yPos = 0;
2d~7QH;m$d var xDir = 'right';
i7c&e,m0KJ _ var yDir = 'down';9GR#C-b+g6I
var superballRunning = true;
,zA\ b4^z6E var tempBallSpeed;
hfB;Ct%m var currentBallSrc;
u:`*U4SFb var newXDir;
*UH3UDLr var newYDir;
p.@D,f A
a-e"Y#AJ Z#s function initializeBall() {R5Hpp6H%rY
   if (document.all) {(L'N e1S\c*y
      xMax = document.body.clientWidth
7R,DL(J%u;TT|F       yMax = document.body.clientHeight%@,eDk;t.}(Sb bP
      document.all("supertext").style.visibility = "visible";(G9V [3\5| j,|[
      contentWidth=supertext.offsetWidth FUO ?!zrRhuv`
      contentHeight=supertext.offsetHeight
R/f}:p*bVAV       }:g\Xz YDn:S+r
   else if (document.layers) {
2s#l\},Qw+a       xMax = window.innerWidth;B'g\9cV'u-iOZ/]([
      yMax = window.innerHeight;S {zb$u,i6v ]1]#t
      contentWidth=document.supertext.document.widthRib9wn_ A9v
      contentHeight=document.supertext.document.height4B e4nEuO8YHk
      document.layers["supertext"].visibility = "show";
$a Rb#rzr       }VF6X(}$oz wRP$}0A"z&@
   setTimeout('moveBall()',400);
^M ZN S V T    if (hidetimer!='')
Lc*?7Wn2O    setTimeout("hidetext()",hidetimer)%ei%\ e aL
   }8~iB6J+W9aZI(Y
y(g:] b4[?3W1xo[I^m
function moveBall() {
6?2L8R4j!uC Pw    if (superballRunning == true) {
f}V"R9sa n3q       calculatePosition();^Bb a3O:K
      if (document.all) {I2jBQ+^S\ _4S"D
         document.all("supertext").style.left = xPos + document.body.scrollLeft;p6bj~5Q
         document.all("supertext").style.top = yPos + document.body.scrollTop;
gI1x ]2N          }
C[7mV M5x)I$zV%L       else if (document.layers) {
J9aY(L:~c+`L"v          document.layers["supertext"].left = xPos + pageXOffset;$QY"aYD(x"P[$D
         document.layers["supertext"].top = yPos + pageYOffset;0k8`e+jdm!e.n}
         }
`,f9QH-j$}-S,y       animatetext=setTimeout('moveBall()',20);
k,Q r6@"i       }Vt? [n7p3w"p
   }
'P/E,Y}pe2s7]G^
c Vy.G5c} { function calculatePosition() {
-b!I~*d nC    if (xDir == "right") {,q0@ZP8qjnD
      if (xPos > (xMax - contentWidth - BallSpeed)) {
d|g&m0^.r6i"d {6H          xDir = "left";
nwn#n3KI(O          }\Fmt+RHR[
      }
BbT#O7Wi&d&E    else if (xDir == "left") {+q!ZEw#V3d K4|6P
      if (xPos < (0 + BallSpeed)) {
%?9^gs T&tU|(T          xDir = "right";
:ty!JTMaG&z          }
E|!Z"VM!s6LB       }/qq*kN,RG Ks
   if (yDir == "down") {
Yq _8at${`       if (yPos > (yMax - contentHeight - BallSpeed)) {
:v/y Gz\DM          yDir = "up";
x:~9x"[PG+_^$A          }
S'w!f!MM\       }
nqe8ujYF    else if (yDir == "up") {Im*f:S"K
      if (yPos < (0 + BallSpeed)) {&m%^W_ [h)d&fe
         yDir = "down";
k0]&X.N S`          }
3` E0r_ mWb$\       }
BQ o;W6z ^,[ Wk    if (xDir == "right") {g%L"AU8R#n Z S
      xPos = xPos + BallSpeed;J-p[ R0N!e&_oK
      }7v U/Z_ s
   else if (xDir == "left") {
;]^6c'A(O D o(n7@q       xPos = xPos - BallSpeed;4o Y a Z3ev|
      }
4fa~SH}*I2r:AA    else {
?z0g^0h9eL"uB)A       xPos = xPos;
y nG;e `t       }'{ O;F%x'[BWZ7A y
   if (yDir == "down") {
(\"? B-@V,H       yPos = yPos + BallSpeed;)h7q v+ADk"v+oo/n
      })w^{k g*a{g'_
   else if (yDir == "up") {MR4Y R0gZrL9i$E
      yPos = yPos - BallSpeed;7Sa$I&i7EF L ^
      }!F ]Hn8X)g
   else {
J)h~@h&s8~$y       yPos = yPos;
4F4F'h [&iF0lr       }
m3| v]9FB?    }2R l'?v4Q t5J5`O
*]*zv3L Wq
function hidetext(){3BH0f,y|%L |
if (document.all)-qtH$~V&?
supertext.style.visibility="hidden"-d gfp%t1~SZ
else if (document.layers)s!Y!_M A4D:r
document.supertext.visibility="hide"
Kh3O1R%H_.@o clearTimeout(animatetext)(M{p/Th!eGS
}vGhZY.lde@

,qv%P]9mS'n if (document.all||document.layers){
Rou.x8w*{+ed'f document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
E)dI6e!{j(w3u window.onload = initializeBall;
N:K8QG R/^]w O ] window.onresize = new Function("window.location.reload()");
j$p B3|"D RxP }
\mc?H_:i0]1_
P9D!R| l6~8V6D_q/d$_ </script>

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


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