捌玖网络工作室's Archiver

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

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

<style type="text/css">
H vv_ J]3_%y #supertext {
_wnZ,O K position:absolute;D-t"C"@ f
left:0;Mh? nP,X,D.U7{
top:0;
A[Nn?D[6nU;dp visibility:hide;0I*n"E-x A`d^pq$B
visibility:hidden;^E1{-WL
}\(k9~C%O6x$J^&k
</style>h%W6V_O
<script language="JavaScript1.2">
hX in0G |/V <!-- 改变下的字体的大小。颜色-->}/I&a_!BE8X
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'3E gydlj|E)] p
var hidetimer='';
Qk!r3Oa XJ <!-- 改变下的弹跳速度-->
l ^'I+yY*_6w"n V var BallSpeed = 20;bfj o"Z1J+X6O]
var contentWidth;;TSz$Sv&pDn
var contentHeight;,_8Rg5t:}hh
var maxBallSpeed = 50;G,a3U&u.b0UW9M'V
cI aH8@Ye @H

"z+`8QPzE var xMax;
@#\3q t0? var yMax;;s+a oHr6Q%l
var xPos = 0;
pr+s7t2s] var yPos = 0;
`9z/?)J+Y3I2x:K,b var xDir = 'right';
N a vZ;n4]}.EU var yDir = 'down';
J }9h~g%{d2v3^ var superballRunning = true;
`ya6C-~ var tempBallSpeed;
3Hn8J)YI l/Pq var currentBallSrc;
,Mw%{8THr#z var newXDir;
(Q b)KR M var newYDir;5A"{9l-R/di2M
;iL;BT_@'A
function initializeBall() {w4hO.Y3V&W*L
   if (document.all) {p4c*WB\6^ kk
      xMax = document.body.clientWidth
2Y"u O$Q~+sn!?d}r       yMax = document.body.clientHeightV7k@Z$M _hc6Jey
      document.all("supertext").style.visibility = "visible";
.P6e]0g5WK^]*}       contentWidth=supertext.offsetWidth
f)m hx Id;DXX6j/~       contentHeight=supertext.offsetHeight8hE!IB.K"u2m2lW
      }9g/Kp;vw
   else if (document.layers) {
?5b;AY?|       xMax = window.innerWidth;)\'M,Dp)Rr
      yMax = window.innerHeight;k'a%p%C pg~%[
      contentWidth=document.supertext.document.width.e7[!Woa l Io
      contentHeight=document.supertext.document.height9D;T,w/a8_|2@1U
      document.layers["supertext"].visibility = "show";
-O$r\B(`"m       }*__`&l"WA'},U
   setTimeout('moveBall()',400);
#o2Y;C a?-xn    if (hidetimer!='')t A5}gu7}a
   setTimeout("hidetext()",hidetimer)
o { kdn    }
S_ V^F&]$g Ma#n ?4Fx~
function moveBall() {V9w,s J*k Q6V@N9k
   if (superballRunning == true) {
)w.P[;Ef"X2B8Y.A/ji       calculatePosition();
lK zWTK6m.Q       if (document.all) {
n_2FKgB          document.all("supertext").style.left = xPos + document.body.scrollLeft;0J4uoBM6}i!V:abN
         document.all("supertext").style.top = yPos + document.body.scrollTop;/^"_ m nF`P`
         }W'Yc#w nH{/]
      else if (document.layers) {
}0a,]h@$u          document.layers["supertext"].left = xPos + pageXOffset;
2xH;a0Lxt*`          document.layers["supertext"].top = yPos + pageYOffset;AanvLC.@3s u }
         }
R/x~d*Pz+M{a       animatetext=setTimeout('moveBall()',20);
Z9?3w7B'|g-e       }
s%HH2?6} L R    }%N-v9GRV

$Q^/Z3s;_O function calculatePosition() {
(_uR&Sua m    if (xDir == "right") {
V D/} e]W W       if (xPos > (xMax - contentWidth - BallSpeed)) {
Q.X.F+K rg_]/AP          xDir = "left";(`#?0X_g~
         }c)O od t;k?NtEI
      }d:|#~6AC0k
   else if (xDir == "left") {
4U tuD"z,G(x^y*d#s       if (xPos < (0 + BallSpeed)) {Y'rDc+G V W%P
         xDir = "right"; C9P$tV J
         }p5b'P|L St?
      }
t0^~1J"`@jT    if (yDir == "down") {`3LKg#Y&?s8x7K{L
      if (yPos > (yMax - contentHeight - BallSpeed)) {
]:U'|&S {/_f          yDir = "up"; Ie/eDNo?;D
         }eS8M!ik5r\1?z
      }o,Z4w3} |2RE
   else if (yDir == "up") {
N%B/b)o/z2b       if (yPos < (0 + BallSpeed)) {ro!\D5Vx"f6C/r&NE
         yDir = "down";})G"W0T\j
         }
HK1q:|UXv&bq(?#k       }
e j Yu ~*eP+JA    if (xDir == "right") {RNcU iqwl(VE
      xPos = xPos + BallSpeed;
exJs f9[ {n       }
U-H2G%KA5M    else if (xDir == "left") {(BS-Wda F9` l*E
      xPos = xPos - BallSpeed;Z2S&qP)^!yw
      } sY^6R7U sFk
   else {
k._XP6W.xwu       xPos = xPos;
u2GRA6I1v       }
n/\DT1b*?    if (yDir == "down") {
-r)Z7OF#l       yPos = yPos + BallSpeed;
ain|,V5HC       }o#bNH%Rt
   else if (yDir == "up") {
2LF,y|w6J{I       yPos = yPos - BallSpeed;
'jXP]4u O b       }
1Y'{(OVT2C)x    else {
hKK4Z$dC2l;d9{6C6{9~A       yPos = yPos;
X@ WQ!h|"t`       }
,pw:dhYl{W!P    }
'a E `kA nJ@ c\ KGw1@g
function hidetext(){
+RID,fN if (document.all)
8Dm7_;W ZU supertext.style.visibility="hidden"~/X#rVR\9T8? a(l
else if (document.layers)*VI4s5^&Nd6j8jf
document.supertext.visibility="hide"
-i$RE3k%m4He!H clearTimeout(animatetext)
d"P!D*vpi;@|0c{ }!B$X2z:Z.m i

@#E4c3bw L-?1iQ if (document.all||document.layers){h/C~,Sr.s0Z
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')E sk2n1U'eq1Gijf
window.onload = initializeBall;
HQ0zLI!BY*S window.onresize = new Function("window.location.reload()");
ZRW9s)D+h [}3Eg| }]V+@J `!@R2\
9I6f)k.W4VJ"E[-Fg
</script>

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


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