捌玖网络工作室's Archiver

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

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

<style type="text/css">5N6Tn*HP
#supertext {.` a4UTTj
position:absolute;j/?z6B$aj
left:0;d/e`8MCX
top:0;
2R;I7[4p P:s visibility:hide;9q_O vv%bOb
visibility:hidden;
.^LOF!@(@6iQ } k(X_#R"j:xi
</style>
(q t(_s$^$h;{ K0`H <script language="JavaScript1.2">oLg%R+Q,In
<!-- 改变下的字体的大小。颜色-->ZeoA| ok q)V.]i
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
2CRgBU var hidetimer=''; gs RR4P:_ kC
<!-- 改变下的弹跳速度-->k'Td%DQ| i
var BallSpeed = 20;3P6y ~hmY{"i
var contentWidth;sE6z3EEp)xq
var contentHeight;
*F6J$u'P p var maxBallSpeed = 50;
yB[+W3E%u k pB%V
G[9KU^ qZQ T&V2m"zLR[
var xMax;
)d}f B L x@ var yMax;!|G1w7gnc
var xPos = 0;9l0d7H f;JF!DddV }
var yPos = 0;
V(xc Gs?\2W8P;q var xDir = 'right';
4E.XL2y@:cpz'[b%I var yDir = 'down';
k/L^QfbT var superballRunning = true;
,?6d+W[ Z3Y-Q @r var tempBallSpeed;
Qu,X2TUQ6jV var currentBallSrc;
3Y.Z?Iw\$s&k var newXDir;
6qju#X?B#h var newYDir;8t2|$XJ_C$u]"K#}
K o$Fk%`0E$En)F
function initializeBall() {/l;dg ig-P1z+B$J
   if (document.all) {
\S#HoW.s       xMax = document.body.clientWidthUZV G` U
      yMax = document.body.clientHeightr"TL;u*H
      document.all("supertext").style.visibility = "visible"; ^ C9}/D}df
      contentWidth=supertext.offsetWidth,\B2c,I Ku q
      contentHeight=supertext.offsetHeight!rg~*f;H
      }s#er(_*bB
   else if (document.layers) {
-pB&QL/\,q2@{       xMax = window.innerWidth;e4q4uF:~3E2f%`X
      yMax = window.innerHeight;
6z1V2j C]J       contentWidth=document.supertext.document.width;F:E.^0c }U
      contentHeight=document.supertext.document.height4J#@S^[
      document.layers["supertext"].visibility = "show";k\#u9G&W}g:oQ5{
      }:|`fgWP#oxc7z3~
   setTimeout('moveBall()',400);e)S Ro5]nEJ5R
   if (hidetimer!='')+{I(Z#Q_*T
   setTimeout("hidetext()",hidetimer)
-?q7m6tEFgP4rSE    }
i z*EQ K aL
*fg$SM? function moveBall() {
4G7hxW3d(lG    if (superballRunning == true) {
HH U@,]8i q-|       calculatePosition();2@:],]7_vH0Dk+e
      if (document.all) {8FfPx7UY
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
qve&?[-t          document.all("supertext").style.top = yPos + document.body.scrollTop;
U(OL z{(n-u          } M,b^+d,{p @
      else if (document.layers) {
iX"GY@xo i0IW          document.layers["supertext"].left = xPos + pageXOffset;X;R0z,j&d%x(}'ejv
         document.layers["supertext"].top = yPos + pageYOffset;
SeiS9g5K          }N"nc4yJ.y
      animatetext=setTimeout('moveBall()',20);
2AS5K1L.fnN\|       }| [;g0vu@3e
   }
WW"}ED'\@cYq $dQ"A C"U"Z r E$v
function calculatePosition() {
{%I~Nw.k[&d6L1H,\    if (xDir == "right") { zWy ~"\F G!C+r
      if (xPos > (xMax - contentWidth - BallSpeed)) {)^+{T m'^ gA k`'k1r
         xDir = "left";t R Kb T3\
         }\P.Nv d+hS
      }
0B.C(U L'Y v    else if (xDir == "left") {
f"D\f@:|!P)vz3Q!m       if (xPos < (0 + BallSpeed)) {
P,Z`3G2sF          xDir = "right";
Yn%K%`%e9MEk;d          }
6M_#u(a;p]&|2J7}       }0gAm#u9T%mi6~ @M r
   if (yDir == "down") {]1H_h@r2g*Z"u)~
      if (yPos > (yMax - contentHeight - BallSpeed)) {
iIqV\Be'mPc)f          yDir = "up";*u;p.e2T2_#j0?iD
         }[ }zJ&Ce j
      }0n8Kq'omE\
   else if (yDir == "up") {
? `2@c$j0]0?Q       if (yPos < (0 + BallSpeed)) {
y1W/W l[U$g          yDir = "down";
%c$doc,K%F~          }Le)ls G
      }
-FX'a&o N$Y z5f    if (xDir == "right") {*A;jcCC-a,N\
      xPos = xPos + BallSpeed;
{1o DsDK&Pl       }
tc+m i\,e#I5}    else if (xDir == "left") {%vW;f,X0jJ/\
      xPos = xPos - BallSpeed;w4]{)[3X:`6J.y6{
      }%kO0I&uOz4m\f6z
   else {b.SPG0d2uB({q
      xPos = xPos;
+rv,fD.r?       }
,K*M)iK;Ra;T"yS    if (yDir == "down") {
~ J B {0n~ V#u       yPos = yPos + BallSpeed;,\$r oO Awt0Htx(S
      }
h4PU-E+kK u    else if (yDir == "up") {6Z@z v5KoEDd
      yPos = yPos - BallSpeed;
| g&aC u!M;j|;lI       }$M D.IT&fX9I
   else {P"~WY!N6MP
      yPos = yPos;
&R}f IW.k)} ?ng1z       }
)AMT~cz)_!eu    }ClcClB&NA
8i GQLtNz"O
function hidetext(){
w0Vf ~d2w Y)}0E M if (document.all)
,Uco} q p supertext.style.visibility="hidden"
+n'Dml&zc B)f/^[zi else if (document.layers)y!vP&TB:\"v
document.supertext.visibility="hide"L}ZY!P2UKR,n\
clearTimeout(animatetext)G NX wP"M:I
}
/a9e1W$bA2Y(Z#H'g,r
T:^I[3[Q&T5| if (document.all||document.layers){/J)T!}0ik f
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
Xig%v\%xD window.onload = initializeBall;Q ^ F8Z L9C] vq C7Gs
window.onresize = new Function("window.location.reload()");_B\`J:x J
}8Z.|$]\_

V ka H O </script>

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


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