捌玖网络工作室's Archiver

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

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

<style type="text/css">wA5D(vf2O
#supertext {d6Hp~K&ym ~Hw\9J
position:absolute;
ZvDF7A9C:c$X$c left:0;f@zVvKI m
top:0;
-H ~fTp visibility:hide;~~H*zqd
visibility:hidden;
!]1kC4[ET+X }(Z k:N2u'uzs
</style>#M1b%X9v9K*}
<script language="JavaScript1.2">*WF*G gUTG!t0M
<!-- 改变下的字体的大小。颜色-->
9t,g8`E&`@ var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
Z.k9|6W8dbS var hidetimer='';#Kv3b5]1x#^M{iX
<!-- 改变下的弹跳速度-->V(E q Vibk
var BallSpeed = 20;
&G{zC U)Pr var contentWidth;/A'LOL,wP1v
var contentHeight;%po,DBv;ey;B
var maxBallSpeed = 50;7oad| {5b

a%F wV$R@2Q+j z
)`&Y)C;^)CCg2c var xMax;
8H al%bC$Y*K var yMax; J6xbaLH-Me
var xPos = 0;
$RV;zl:g0k var yPos = 0;
)MD1KQH6i:ko var xDir = 'right';s6W&x:_0R6k
var yDir = 'down';/|]ozx0t:L8o'P
var superballRunning = true;4q6U9cV"q9oI-x
var tempBallSpeed;#R6yV*b@ B
var currentBallSrc;?e U+D.j^|}
var newXDir;
x)f"@N G var newYDir;
7`)C%} ~3ef)j
Ye}#A8uOM3d ~e H function initializeBall() {
+U&u4ZG;F]/t!{    if (document.all) {
y/xD:ye*dr*a/I}       xMax = document.body.clientWidth
_K*L9Ev6u8? B8G       yMax = document.body.clientHeight I"r&m9F|JO{
      document.all("supertext").style.visibility = "visible";3q*Ky2vV!BU
      contentWidth=supertext.offsetWidthQi#ut&aT"] X'o,w
      contentHeight=supertext.offsetHeightd4C WgG;b!v$k
      }E9kk)R*T S-l,C#HE
   else if (document.layers) { Nncp?8l
      xMax = window.innerWidth;
_"my,r D ks4Z}4S@       yMax = window.innerHeight;(j1`,MG I;GpTX
      contentWidth=document.supertext.document.width
%~7^e:L6l"\8s       contentHeight=document.supertext.document.height8`6sC qm8A
      document.layers["supertext"].visibility = "show";
5?e\'P-M(]w5H       }
l-[4]4KYf    setTimeout('moveBall()',400);
3PT;q^OyT{/h|    if (hidetimer!='')QA MAU,Ki1F&m
   setTimeout("hidetext()",hidetimer)1v#pu;v,? MjO.v
   }$X:O5r8dwM.Ybrk
y1H9_Q$R.E1m$[?
function moveBall() {w `1P&kdb0X}*F H
   if (superballRunning == true) {
-XkC C(l       calculatePosition();e z/C ?Rm%x
      if (document.all) {9Ue`^i D
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
H7O3Ew {3m;^jj#Ea T]9C          document.all("supertext").style.top = yPos + document.body.scrollTop;)fQ$E TB't6Eq5c
         }_7i] O,M-K
      else if (document.layers) {
:a9f4o-^lu"Xa6y          document.layers["supertext"].left = xPos + pageXOffset;y4YBEk8G{*}TH
         document.layers["supertext"].top = yPos + pageYOffset;
X}8[P^2G          }JX ],ra3Ux
      animatetext=setTimeout('moveBall()',20);4U;uoE#u7h
      }
ad{C9Il    }8M'N"`Z/D+Fm
gK2U9@i'Phz
function calculatePosition() {
2dM\:d a6z    if (xDir == "right") { Wt VG'Ov
      if (xPos > (xMax - contentWidth - BallSpeed)) {
x0{4|2l+izb          xDir = "left";
'h%u#jx o'X \          }
Uy h7dx\!NS       }E2UaJO
   else if (xDir == "left") {utu1Kec[/_ Lk?F
      if (xPos < (0 + BallSpeed)) {
MLO0`#\pG6U          xDir = "right";
)CL(V rN8y          }]?H_fgV @7t
      }0~7U/up M_5}b/??
   if (yDir == "down") {:HLHh+w:a
      if (yPos > (yMax - contentHeight - BallSpeed)) {
i8A8XA0[J?(M?|          yDir = "up";*K9exNvglx2[
         }
)K&M#B@)WC2Pl       }]]wlEUM U2n7C|
   else if (yDir == "up") {H B IA^ l(x/\)r
      if (yPos < (0 + BallSpeed)) {W\*YT_5etr
         yDir = "down";*TXqG f-Gw7[
         }*SSM9KB f2y-w
      }
,f3R ?iZG ^2g\[(Z    if (xDir == "right") {
i#Xi B0y(lDQ/vK       xPos = xPos + BallSpeed;
$p"I6l&uYL       }
l\ }b hQ,D]    else if (xDir == "left") {
Un*lN8u2jHv G|_       xPos = xPos - BallSpeed;;RHEj7?F!Gs+M
      }L%M"Wf4_1W,g"QF
   else {
2\W Tc"n \A       xPos = xPos;
%aqJft,x(ol-^       }
RR5pj!_    if (yDir == "down") {
2kd)||7} cA       yPos = yPos + BallSpeed;
/R1DMYUP       }+hMR(V}s o{
   else if (yDir == "up") {'z#gt j)o!g7VlV
      yPos = yPos - BallSpeed;5S[M-q n0zZ
      }2^/[f XO
   else {
1bdBI6\t [{       yPos = yPos;
$|#E w%Y7D2O%bfb       } R0D ?(aC2Y`@5PD
   }
r9k)G)@-M)j.R
b/r%my9C\p8`v(G a function hidetext(){ k GHcs.Xg
if (document.all)
_i*Q+C i({Dhrl supertext.style.visibility="hidden"
D \sh5R#i6k-a:{ else if (document.layers)r#qp$G:c4J
document.supertext.visibility="hide"J/r;m.kpS
clearTimeout(animatetext)
l YOC+T,c$DZ }
%m2D)dmQYo_0N
2t$c#P(~#B/Z$G@V if (document.all||document.layers){mMlY}|YtA)D
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
v:NP"E1W yM&S.O window.onload = initializeBall;'Bt#O5@XU\"GW6m(^
window.onresize = new Function("window.location.reload()");M!Ni4|K'Q[
}
`)yuY}i^ :e T"j7fRN
</script>

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


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