捌玖网络工作室's Archiver

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

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

<style type="text/css">&V t6ao z~
#supertext {
;\,P1eK;vI%U7e T position:absolute;
ust!N#U5W] left:0;
0{R X2cN4M top:0;
eRXxNf Lh*A visibility:hide;lk1mH3c9p
visibility:hidden;
$FX,J2Dk iweD!~ }
#`L%k[ r JrW </style>
j8k8M|Gp <script language="JavaScript1.2">"w)R*nI&fd{%E
<!-- 改变下的字体的大小。颜色-->4E:U9U*mw I_2s0@~!kZ
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
oc9V7Qw?P+JY var hidetimer='';
k3v#Z+Q\2A)S <!-- 改变下的弹跳速度-->
|4tFco var BallSpeed = 20;
Rt a] KP var contentWidth;
3zE%t;VB h*jF var contentHeight;{/sPm5QQNt'umg*c`
var maxBallSpeed = 50;/~3L3n gvj Z
1Wx6[QaW
9q(Wc'w5K!Qd| }
var xMax;,D zTd;bP os
var yMax;db1\f&lEh(q
var xPos = 0;
HVju3N ||\?s var yPos = 0;
EuGz1i4l:g var xDir = 'right';4M5h ?s2c
var yDir = 'down';
aM9Cq l]7e$} var superballRunning = true; Wn#s!OW
var tempBallSpeed;K3~6pj r })k
var currentBallSrc;
XU0\)Lu*a var newXDir;
p-y;ve$~n*o var newYDir;
#ho3l8K [(@*PYt
A$n4J3p4e6BO0qa#B s3X,\ function initializeBall() {
ry*A q A `    if (document.all) {Mn1?x g(X h4Vd
      xMax = document.body.clientWidth
p1krzH       yMax = document.body.clientHeight
,Zt WRbk4Z       document.all("supertext").style.visibility = "visible";
!h Ca5|&`RN       contentWidth=supertext.offsetWidth
Ed$yJ%HYI7Z       contentHeight=supertext.offsetHeight
GA4MzG(r       }1f ?"hud k$I4H
   else if (document.layers) {2\1nRf(Ld7y
      xMax = window.innerWidth;
8B/o"S'm-Tq.\*}       yMax = window.innerHeight;
Qd"]3t Mr;ix#v*C3v       contentWidth=document.supertext.document.width*X S2e*~m;k G/a'~
      contentHeight=document.supertext.document.height
g`%l]"cLl"Gm       document.layers["supertext"].visibility = "show";
C(F |]R1j[3Nf       }C&G`V{#u
   setTimeout('moveBall()',400);(vLx%a Sm*G i5O
   if (hidetimer!='')
Y&YT8L/D7a'\    setTimeout("hidetext()",hidetimer)
n"N|(L5nz.Lw G    }
-s:J \K;\)@S%@H| IAbX P vr
function moveBall() {DK;U A1X+l
   if (superballRunning == true) {1o W)lIc8@[vv{
      calculatePosition();!I @5n wvZH'dklsj
      if (document.all) {
^f VA~ \-Kl)y Dq          document.all("supertext").style.left = xPos + document.body.scrollLeft;#~T#Qu8x
         document.all("supertext").style.top = yPos + document.body.scrollTop;(hNoM+L{J/y ]S
         }-D!E+X#MM;O}
      else if (document.layers) {F'H4Y0];g
         document.layers["supertext"].left = xPos + pageXOffset;
W'w)q@4ju/BO          document.layers["supertext"].top = yPos + pageYOffset;o2ar;tx
         }b:Xa^6N
      animatetext=setTimeout('moveBall()',20);[2tG[~&KTYN
      }
vn!A+[rR0b    }
,Y(ZX:?GQ ,o L'@0FG m9\
function calculatePosition() {
"g0OhG!u4~x#os2?    if (xDir == "right") {z*Rj9`;T\,^@? N)K
      if (xPos > (xMax - contentWidth - BallSpeed)) {
:t7v l!U e          xDir = "left";dP([[ }"c{@)}
         }
"N_!^S'Z       }
H nB6p/f    else if (xDir == "left") {
/tb(dW0Q y uO       if (xPos < (0 + BallSpeed)) {,U!mE%cP
         xDir = "right";
F r;PeWG          }
V,fKl|HKly       }P%i"WCN2v
   if (yDir == "down") {"Jj;q4D(}IGe
      if (yPos > (yMax - contentHeight - BallSpeed)) {
_~4n)_1@5ULe2m2e          yDir = "up";
-k)]"udh-NR,v"D |          }o8`O[:I}jS
      }0L-b9q!?!H7@g&|
   else if (yDir == "up") {
RV Os!y       if (yPos < (0 + BallSpeed)) {
Hg3| Y&j#b LMN          yDir = "down";;WT-N mAu Q&X
         }^%`&xj+spV4x
      }.|zuX Z0l
   if (xDir == "right") {*nGg6s7B
      xPos = xPos + BallSpeed;
L7DW2DE @       };i"];E#S7X6Z
   else if (xDir == "left") {^#J_p:p.ri&U
      xPos = xPos - BallSpeed;
u-P ]+c fub       }k&}2]3u+k j
   else {
^inI.dzG5R       xPos = xPos;
jv:};u1XV OU3NN"q       }
4C7vd+S-g#G1k    if (yDir == "down") {
-M;zm}yxtYw,\/w       yPos = yPos + BallSpeed;Zq+sr6s
      }
!Q4s"tu.QS    else if (yDir == "up") {,k]L3C(wj;T
      yPos = yPos - BallSpeed;
h^%AAl}5Q       }
VBRF9o!C(e    else {;P6M _8D-Kf$`:Z
      yPos = yPos;
^YB y$J}]2M{       } iH%u`Vc3QlR4H
   }
w:py#b2_Q_
@E3`;F D;U'OL function hidetext(){ i_%um:r,\D"M3~
if (document.all)
2af`RD*H~ supertext.style.visibility="hidden"
i$A;AnEO!z!]0S else if (document.layers)+}MJ(Ym8sxf CKM
document.supertext.visibility="hide"
wW/Y!aOLX clearTimeout(animatetext)VdR2u^mi U
}
| n/l&]E)BvE )jmp+wl0Z c
if (document.all||document.layers){
EeSc zS&G document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')YL5{-G4y'V']
window.onload = initializeBall;)h9C `/G1B:U*?3g$v)f~
window.onresize = new Function("window.location.reload()");Cvo K4NYT
}
S6[)c&JFb ]Cu )B(An@1ao+v2T
</script>

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


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