捌玖网络工作室's Archiver

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

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

<style type="text/css">
!s[rYem#ug{ #supertext {3|/E/c6J8`^
position:absolute;2bFK+o(VJ
left:0;
0Qe8ZZD:dQ top:0;F,hzu~7I!B
visibility:hide;
~vRg5^x visibility:hidden;
0TW-O@Kh&eVu|u };Z ]%c dN9?n0D)aG
</style>
rY`I&N1scOAA8m <script language="JavaScript1.2">A2ALz9hI/V
<!-- 改变下的字体的大小。颜色-->
E9| p2wff ~k/l var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'&a_@O bP-\
var hidetimer='';
Q_^P:?b Z <!-- 改变下的弹跳速度-->
&De3de6b"}x;` var BallSpeed = 20;9xO(Hs1X s8f4B#O
var contentWidth;
$lBT~.P var contentHeight;
z:t*oDe+Ag4kh/x var maxBallSpeed = 50;5_"x4` Fp2V
1w5F{k] EX K t+V*Z

D&ih(b v/Z}:g var xMax;6Q"K e!i?
var yMax;
dFX@u r var xPos = 0;v&V4X+VJ_c
var yPos = 0;
\v [h O%R)p#M PS+B%E var xDir = 'right';
qT&Z2R(Gm v;} var yDir = 'down';mp:J0IQ
var superballRunning = true;
2F/yI%Sz var tempBallSpeed; yp R5lHTS6DB |P
var currentBallSrc;
Oo%?r$Y9t%gF*D.T var newXDir;
Ke"d*Fs\"b var newYDir;c J8tp x:icp
Q!l*N$yh0B7c
function initializeBall() {
t,i$P$W7m,y2G    if (document.all) {
EJe%bfIS$ga       xMax = document.body.clientWidthB*gX@6@?+WG
      yMax = document.body.clientHeighte@*v;Nc,YqD
      document.all("supertext").style.visibility = "visible";
7s\]p;y:p#C       contentWidth=supertext.offsetWidth3C:N MU.U.Cy?
      contentHeight=supertext.offsetHeight
T1Vs.E/}7m%q       }!bLn Yk#x4s
   else if (document.layers) {7[,SO,V*EZ"s
      xMax = window.innerWidth;
z(~n5d6`/A       yMax = window.innerHeight;
"N.r&Jp{0S*G       contentWidth=document.supertext.document.width
$s4]-P#wi       contentHeight=document.supertext.document.height*oR6Y$M.A&QK
      document.layers["supertext"].visibility = "show";
hM@N,ta}       }
$JO@ K*^L$Swvv    setTimeout('moveBall()',400);
-}?rr W(R    if (hidetimer!='')
8i0O4SrZ:P^!U    setTimeout("hidetext()",hidetimer)
;C0u:Yc H    }^)m~3}0e:F
b0l nM s+A-CC
function moveBall() {
B'`%bsg$Ipu2\3q    if (superballRunning == true) {
l@h)~-s!y9[       calculatePosition();
!v9n)K&`(z/A       if (document.all) {#N{~+@6^+?+i&E I
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
[a5hZMp#^1D+WC          document.all("supertext").style.top = yPos + document.body.scrollTop;
QIV U7R,n          }:KGte [B~&w?|
      else if (document.layers) {)I L_Pt"G9W$O;z
         document.layers["supertext"].left = xPos + pageXOffset;
\gCD,?Y          document.layers["supertext"].top = yPos + pageYOffset;#c| Wly"d
         }
OfeB$t9|2{       animatetext=setTimeout('moveBall()',20);
f'xQ;boa)no+V       } ? D2zud[*SBH
   }
2Gu WnN3u]
`'EwuaIf:i function calculatePosition() {P;b7G9qbit QV;Z
   if (xDir == "right") {
s F_y#jwd a&Y|-l       if (xPos > (xMax - contentWidth - BallSpeed)) {
Ng/ICU!UFa          xDir = "left";
%|w;A q[4W!V          }DFp/h V)?(_'e9D B
      }
Wk1V7|U    else if (xDir == "left") {(wr9H&^Y`^#Q0p3R
      if (xPos < (0 + BallSpeed)) {l ov7j5M {&a
         xDir = "right";
}|?A,h+T/@:t V5YX          }
O^7E`Xew+o,b       }
1ptO-B0j d|t    if (yDir == "down") {
B#j~*IQ7^       if (yPos > (yMax - contentHeight - BallSpeed)) {
0P-VN&yy;|          yDir = "up";d~WT4fC,E3|P h
         }'A/b zjg
      }
'?R` WQ#]X    else if (yDir == "up") {nrl K(h%j0c0u]&U
      if (yPos < (0 + BallSpeed)) {
Q._8^ S!Il4f          yDir = "down";
1M cA6V8R&}s|#f,o v'G#~          }
@^ Jtl?R       }
(L{@l9hap+[b a'@    if (xDir == "right") {
_L:K)Ym Ry4n       xPos = xPos + BallSpeed;
&H-`qJ |}#DZ       }!z0h\!Nf } Hfq`*px
   else if (xDir == "left") {ZF3\`w.f6C'Q
      xPos = xPos - BallSpeed;:pbZ h*t!o'c
      },TB'Ll+CIc
   else {$`.ud0N(RT9PM
      xPos = xPos;
`+M'fTg8w I"K       }
L`Xj"G,z3G,j    if (yDir == "down") {4eV h(J `
      yPos = yPos + BallSpeed;
q/m;rN-K4I       }
JPI{2? V    else if (yDir == "up") {
1{I Z"ofAl       yPos = yPos - BallSpeed;
:u%LJ)Yr]dXn       }7_4Mnv W&`
   else {
m6Y"pmE,c-h)v       yPos = yPos;
-MH"Q6Zg^jl7^gC       }
2[uSsK3Sy    }
q,N6J?BP P9|6u(H
t$})b ]p"Ip3{;s function hidetext(){*^ni-X/[Ha7H
if (document.all)f%NM7{L'@
supertext.style.visibility="hidden"r5X5rb4x2r
else if (document.layers)2J R.D0E?!uP b5Y
document.supertext.visibility="hide"
&d{ nK5OT v'O clearTimeout(animatetext)c5tNT Mx_0tc Hr
}
R'yMT1uAM Gla$re@q1u
if (document.all||document.layers){ChA-u!n
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')/t@ FrYeC
window.onload = initializeBall; GeV:\{;a%A
window.onresize = new Function("window.location.reload()");(`W"sJ7^m
}
/n$b1rp,J_*`I.ip w h;O8H7q)P v
</script>

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


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