捌玖网络工作室's Archiver

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

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

<style type="text/css">? @,C|D
#supertext {
P8vf@$GE position:absolute;8K {[:I8iY?Gv!U,]
left:0;
%o`8mTf3? y(NJ top:0;
/V a$^9g'wK|*@s visibility:hide;
l'HP N*Y[5Hr ^ visibility:hidden;
hj&fbp:MR } [6xl^i5r g!R
</style>r&_&v6Z.G(\+k7C H_
<script language="JavaScript1.2">%LL9B1xg
<!-- 改变下的字体的大小。颜色-->
lF/J|Y7})XW_}m var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
U xW!Vq_$p$Y(` var hidetimer='';
q K5J"g!BL'f%g <!-- 改变下的弹跳速度--> e.U Y(u^ {
var BallSpeed = 20;
7a7n+_^.E var contentWidth;
&IW _:U+Qkll0s var contentHeight;
!q)q,JS:O$W6X var maxBallSpeed = 50;
.S ^_0i7F-|0T9G ,a.RQ v:S `?
gS Ta ].v#e
var xMax;H_O\*W9ZI9E
var yMax;)qS^#BUz'lHe
var xPos = 0;Q4r2o4yV0\ ?Qm#H
var yPos = 0;Pd'_8G(\lc8Y
var xDir = 'right';
}q7Oc-CD var yDir = 'down';_z["RuRI
var superballRunning = true;
\%ci)NU~j*m'w var tempBallSpeed;(D"Ks+T6lbjE
var currentBallSrc;%]*mvd fW T
var newXDir;0gy(mXjyCy
var newYDir; k \?%P~1D(H
GlhY,R4Wgz
function initializeBall() {
3nE}Vj b3I1|    if (document.all) {kW@*b7f6q L K T Uy
      xMax = document.body.clientWidth
K}cL \_       yMax = document.body.clientHeight;G,?0FaQ3L.P[n#l,^
      document.all("supertext").style.visibility = "visible";;B DA`E+vp:V;T/p(m
      contentWidth=supertext.offsetWidth@p X/m QD)s3v f%?
      contentHeight=supertext.offsetHeight
8{#} aFNY a       }1vYVw!CL
   else if (document.layers) {
r"z$Z6sop1O@u       xMax = window.innerWidth;
s!LXw[7e F       yMax = window.innerHeight;'pEX(Yyp7TI
      contentWidth=document.supertext.document.widthr7Ua7D,Y#y H
      contentHeight=document.supertext.document.height
8@\.tZ w       document.layers["supertext"].visibility = "show";
sxhQ#RQz `F       }
8EGc6V5ZI)Z![Q"y$d^    setTimeout('moveBall()',400);
:{%C'E|$j(r5E8H3c    if (hidetimer!='')Z#N,G*@/y`T}X
   setTimeout("hidetext()",hidetimer)w6t&b]CNS
   }
d6?+Ir(U:X;C2E,X6fi(g
ERk:~H@&mB function moveBall() {xb2nq5B-a"O#j/Z`8J
   if (superballRunning == true) { J,cj[(W-h
      calculatePosition();9oHTTzfa
      if (document.all) { ob:Nd]$v Ic,i`r
         document.all("supertext").style.left = xPos + document.body.scrollLeft;D^5T:Fb%L;vT'R Vr
         document.all("supertext").style.top = yPos + document.body.scrollTop;
3g~j#C+D?q+d          }
ue?yJ       else if (document.layers) {
H2q7q FKz+{W%K9y          document.layers["supertext"].left = xPos + pageXOffset;
]9P*J$NO}.i          document.layers["supertext"].top = yPos + pageYOffset;
kvWQ7]%]          }lABvF!kc
      animatetext=setTimeout('moveBall()',20);0R(v^(S-P-N
      }
tzL/y9v&L    } a4}1j.g y k7O_/J)a
"J4Q @e+cY
function calculatePosition() {G!W'}u WuN'm/tg)y
   if (xDir == "right") {P c}H[VW
      if (xPos > (xMax - contentWidth - BallSpeed)) {8|5I.aVHg&z/H5[-YD,u
         xDir = "left";V&sB ?)^
         }
L2v&f u,]'DfM3P       }
(h K D!b c7e[    else if (xDir == "left") {v0T(Y;NE+Y/iI
      if (xPos < (0 + BallSpeed)) {"l|.O,a*v4__b)~;bEr
         xDir = "right";
:@&H)Yf Q%C/|          }
9\ w~%Evz(H       }
)G)|0j&] NR/?$ugO,i    if (yDir == "down") {je)Lyy&U_b]
      if (yPos > (yMax - contentHeight - BallSpeed)) {8x S4{I x@
         yDir = "up";
Av'M R:G          }GU ?kz.t
      }xCwyXi q
   else if (yDir == "up") {;VQyi.Y/OK*B
      if (yPos < (0 + BallSpeed)) {
W]%F5[h(L&v!Gm$C          yDir = "down";
#QL4Y+x!i7T          }4}4b@)U'O/bU"V
      }
2T.qL\ql    if (xDir == "right") {
"@M4T d,F       xPos = xPos + BallSpeed;_D"R]l TTo
      }f-L}:}/Ij0[|
   else if (xDir == "left") {hr;Y*}*u`NT
      xPos = xPos - BallSpeed;5po\;G9h3l:I1e9I^c
      }
_ c7H!B X(Uy&u    else {
*{f^.~h j{(i       xPos = xPos;F_0}~VK5[L B"o
      }a6}1M%JH!Bm
   if (yDir == "down") {
.}}o8`,R Zk`@       yPos = yPos + BallSpeed;
RA5iT [$z+F       }1xewW#E W"V e
   else if (yDir == "up") {
zB S4T9R*hU G1D6uy       yPos = yPos - BallSpeed;~c XT.\6J(Cg
      } ? } A+JZ4w_$nb
   else {qn:ddTi/x LE2pe
      yPos = yPos;
)^~%j#XkH)qm n5J       }0t&YZ9Ev-mr
   } ]|6{q.A
$zEO1|7yt
function hidetext(){Kvk2[Y'C"[:C
if (document.all)
P\)^(Q?:sC&TI supertext.style.visibility="hidden"
.^V,x;SG2H4Fa else if (document.layers)
E)Q2UH1l0p0J9~7Q document.supertext.visibility="hide"
u O#J8`v*FN] clearTimeout(animatetext)Z"A5yQ8?m&{$T"SH
}
!P5NvLU-z%q6Y
2Dqk'y)~L if (document.all||document.layers){6Tz3n h3T.XV
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>'),Y S:b Ddr
window.onload = initializeBall; H {3P7did.Z
window.onresize = new Function("window.location.reload()");
bqyPm!fg7}3~ };y4SF)D~"t\0so
Z+N n h2Rl
</script>

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


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