捌玖网络工作室's Archiver

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

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

<style type="text/css">9F9N{z6F%ev`2e)[
#supertext {y9?&g1n9f&l _[
position:absolute;-EiZ C'B9[Y*J0kGH4[ G
left:0;
v*~\/E/gg/KmC top:0;0u:{lA0~
visibility:hide;
v{$s;E4n P z$Y visibility:hidden;jk6f7|7U8[d P.Y-[7~,V
}0ljND$~~$|!yZ2QY
</style>X'b-J(u,c1JB1JV
<script language="JavaScript1.2"> _R J:dB6L/LG
<!-- 改变下的字体的大小。颜色-->o pmy'ipg,hPW
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'(kwoH"k
var hidetimer='';
5b-U*G)jz <!-- 改变下的弹跳速度-->
!zu9\w-G.~)Tp:M var BallSpeed = 20;
X w9W'uTi6b)J8a var contentWidth;
3W/m&E*zK2~v var contentHeight;;g2V)K:rVPQ\Oi
var maxBallSpeed = 50;
j#Hs(DU-N7Z Hq$V x#eCg.esS)s)G

ck w GW var xMax;%T#]1wV B*@_r K {;q
var yMax;&` meT;g4V
var xPos = 0;qMu/x X
var yPos = 0;.Zlpn h\ `
var xDir = 'right';
%Bv7}]'t6y J*c var yDir = 'down';
tLKj+Ld;bP7{0U var superballRunning = true; `&RM"Y!~*wF ^~:KE
var tempBallSpeed;
5agu._`4K var currentBallSrc;4n*}:t)`q|s3V{+C!X-u
var newXDir;p!D H)O$O
var newYDir;@&G ES T;T?U Z"w H
R _}6fl-g`-m
function initializeBall() {
?H c!q*kf`+A+@    if (document.all) {
;s7~X-t|-X-YG~       xMax = document.body.clientWidth?H4h"W Wg6OH
      yMax = document.body.clientHeight
Kx/BXs/cJ Z       document.all("supertext").style.visibility = "visible"; g'cA7I&r L+v
      contentWidth=supertext.offsetWidth
Ge,YQEBq;f       contentHeight=supertext.offsetHeight
;PLf r.z       }q8aR"HG ~
   else if (document.layers) {Nbt~\9XXh
      xMax = window.innerWidth;
H+k%Ws3\h*F~Dk       yMax = window.innerHeight;2xp,mxG
      contentWidth=document.supertext.document.widthEE_Q"OJ
      contentHeight=document.supertext.document.height}6R Qe8_UW7P
      document.layers["supertext"].visibility = "show";
1]O T2XD;UWML       }
&P5Llxw/Jv    setTimeout('moveBall()',400);u5[ G6a!th~a
   if (hidetimer!='')
:Y(t;NS1K!x {b~#z    setTimeout("hidetext()",hidetimer)|Os*Lw ]P
   }
j+|;cIc-e| R^}D
f:fD;Q*z;| function moveBall() {[/h]QDNR1@
   if (superballRunning == true) {9Qt vn9R4NH
      calculatePosition();^t"| j9y"dK:E
      if (document.all) {7C,u'qN!Z
         document.all("supertext").style.left = xPos + document.body.scrollLeft;eq:i9[&}(R
         document.all("supertext").style.top = yPos + document.body.scrollTop;
;cz9k3?UT l f[          };|3V4lB:K.jzr*m#D
      else if (document.layers) { Z Ca K.X,`&w
         document.layers["supertext"].left = xPos + pageXOffset;W _{ wo*Ih!MD
         document.layers["supertext"].top = yPos + pageYOffset; d&QY'F7Y3^0V
         }*~Ln w.lI
      animatetext=setTimeout('moveBall()',20);&Tq:a z+[
      }
h7Y,l7p4v`    }
+nio+j3]
2OST]$z function calculatePosition() {1b-_SP`
   if (xDir == "right") {
G:qi,iuj ?       if (xPos > (xMax - contentWidth - BallSpeed)) {u}&a%^5H8h/Q/d
         xDir = "left";(W#rl~w ~x
         }
9cJ+bS%?P       }
h Kl,MZ(}/C    else if (xDir == "left") {se(j0n:@(m0G*B
      if (xPos < (0 + BallSpeed)) {
V6WK v*wdf4A+ox|          xDir = "right";
+T)N+e4n~ i E6V          }%b a"YO.p N"u`
      }s srt7t%~7I
   if (yDir == "down") {5\zG0U-G5ju
      if (yPos > (yMax - contentHeight - BallSpeed)) {
M o(x%v3O          yDir = "up";
E$L1w,`Rd m&{          }
'vC+U#pwM       }
6F"W#G_W6K D8e2V}R    else if (yDir == "up") {
9]UE)n.[#b _dl$^S       if (yPos < (0 + BallSpeed)) {
I\$gcz bj"A,_          yDir = "down";5ev)qS1]YcVWu
         }
$];m1lN C6bYdQ       }#D,lRBJy
   if (xDir == "right") {MM!r `LE5v$Bb
      xPos = xPos + BallSpeed;
)Vt\L&ftH2x       }
Y3D4U6r Z0n~2e-wa    else if (xDir == "left") { Z'NUt,|/J"jRA7W
      xPos = xPos - BallSpeed;;\z y5jl1]
      }j4[E%cs+OM
   else {2tr0FIE6Z$s K
      xPos = xPos;
@usU7B4lb9d3^Ds       }c!YA?&y Y/@
   if (yDir == "down") {
E,};Wg^ ipQM2d6Q       yPos = yPos + BallSpeed;w~httS4q f
      }L6j*|T4G/u7W}L(a Blc+O
   else if (yDir == "up") {'n4F p@ su'w/`f \
      yPos = yPos - BallSpeed;
-^1{:p3]Z0_;D       }
N6P#v9{9?(Bun    else {#@A K5C`%\(v]%Lla%}5k
      yPos = yPos;!H:\/|j!^0uv${
      }Q#FT? di
   }
l;K{yr-p [5a )B(K*W%V(yB
function hidetext(){
dt3Y$eK1DBV!H if (document.all)
;A's3ws!ylc| supertext.style.visibility="hidden" sK)}wdp%V
else if (document.layers),f.u$@)v3Zq1V5i+|i
document.supertext.visibility="hide"S,M ~r%e nBn
clearTimeout(animatetext))R4eR!M'Zy}h
}
6xt Ar/b:iT"H
2t%A&S pms yw if (document.all||document.layers){-s:o7R2Oadn
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')*h1C#YCN ha/S
window.onload = initializeBall;g LE'Q1OK
window.onresize = new Function("window.location.reload()");(} TZ*i3y;dK'Q#jL#t
}
T_KH x7o-z6j'w Y$g `O,f]'^k
</script>

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


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