捌玖网络工作室's Archiver

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

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

<style type="text/css">
PL_1d In #supertext {
$FE/z h4G7N%D position:absolute;r4W4xg$sb$M
left:0;
5dtX/P9wH?tS[0}.`u@ top:0;'AW [K+C
visibility:hide;Si+rYR-S%cq.U
visibility:hidden;U5w!I.|!k7h[
}
J(\ e+X u2s </style>
2L/EOZ [B8r7i0uy <script language="JavaScript1.2">D"Q1g_-l;eCxW0ZK5B
<!-- 改变下的字体的大小。颜色-->
8M:bw]](e2p2n3z var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'7`&j1mZ2w `o0j:V
var hidetimer='';
W4Gs3c;xV4B <!-- 改变下的弹跳速度-->w&Ee*V'q3T y
var BallSpeed = 20;%n0iQs9V1? h/f
var contentWidth;
7a/HS{Vd;j&H-y var contentHeight;^ j8H? N9WU
var maxBallSpeed = 50;
H BF*{ J+u
y2}sTLl 8V|O%p_F7V!Pz4p
var xMax;
,}|2I4MlK$HI var yMax;*y)?Ye&A}3W
var xPos = 0;
6b2a4|$U2u/D var yPos = 0;"U;ZK7z]Sf
var xDir = 'right';
9{5t y#u3j-{V){"P var yDir = 'down';
|Q$X,xn+GXY:u5i var superballRunning = true;{1B+ePP3lh1p#d
var tempBallSpeed;
])a`~+W`v%Et*C var currentBallSrc;{m&Fz2n~ N,{
var newXDir;gi_X1wy
var newYDir;
d$br-R bR !\@'L:~a0t
function initializeBall() {
K-yK}$C[;se    if (document.all) {
A#kpv}B8h       xMax = document.body.clientWidth
.ZMy0s i(q yH       yMax = document.body.clientHeight
Slo7xnW/I^8U+x       document.all("supertext").style.visibility = "visible";W'x u`3ODxTBU3v0B
      contentWidth=supertext.offsetWidth
}v6sk%v'M0_       contentHeight=supertext.offsetHeight
1fgpC0lg6Z~F       }]v,yPyso3[;ki$K&V\
   else if (document.layers) {t:X o+o*c5rd
      xMax = window.innerWidth;
3T \3j {k7y H4?X W3K       yMax = window.innerHeight;S n`d] pnLf2U
      contentWidth=document.supertext.document.width
-^%UMz Q8\+bF       contentHeight=document.supertext.document.height
A'gE~gsF       document.layers["supertext"].visibility = "show";
Vt2wz6j#y       }
3tbPZJ`    setTimeout('moveBall()',400);
9j6_ @ t}    if (hidetimer!='')5rw ?W+J$PK
   setTimeout("hidetext()",hidetimer)
Q+\9Y H y(m    }
OP?8Oz's,P2h
GN?"Gisue { function moveBall() {|;V-c:@/vR4k
   if (superballRunning == true) {
gj]3\rDv,Ps%Xe       calculatePosition();
Y'e{(@0A N%dC9s(s       if (document.all) {
(Z`}1B/B          document.all("supertext").style.left = xPos + document.body.scrollLeft;|u4z!I7q L|'_x
         document.all("supertext").style.top = yPos + document.body.scrollTop;u$N$HSU
         }bP/Ng4cW `
      else if (document.layers) {
(mFQ*N#Ve,T~'n"u+`          document.layers["supertext"].left = xPos + pageXOffset;
b ThV-|&\2{9g          document.layers["supertext"].top = yPos + pageYOffset;{6EaqB b:q6I
         }@.\6? c L^)u
      animatetext=setTimeout('moveBall()',20);
U^J"eb-`       }V-th.~/^5i1N
   }
$`*w;yy]U [CR&F7y v&a!n
function calculatePosition() {`? I de6N7]\
   if (xDir == "right") {
dJc3X6\       if (xPos > (xMax - contentWidth - BallSpeed)) {
y]0|GqcT5\ X          xDir = "left";
6G5I|Sp L f0Y          }
j l'Sps)z u       }
\:]7L#Fb$Y    else if (xDir == "left") {
+`O7`|*h       if (xPos < (0 + BallSpeed)) {
/B-A(]H aDg ?          xDir = "right";?m8m9z|EFgz;QU
         }
1uW"| N Zh       }
9S2^@9NOes    if (yDir == "down") {
%d S9O-y:H(U7M'R R%i       if (yPos > (yMax - contentHeight - BallSpeed)) {C6@:mu&o#I Q7P
         yDir = "up";2H!L%[_4uR/l(k^
         }*h2D,Hg.D2Ou$P
      }c4s{K4s+n;e-u\
   else if (yDir == "up") {3^#`-o!q+nb
      if (yPos < (0 + BallSpeed)) {
Z4dKrZ b          yDir = "down";p F)LG:E$B9Wz4n
         }
q dit-Uv(A       }
.v2{B} c h y    if (xDir == "right") {0] i8z)d J4~$m
      xPos = xPos + BallSpeed;
-M8Tq1aEN*g@       }GE4E~J0p){O
   else if (xDir == "left") { r*`a:e%q
      xPos = xPos - BallSpeed;
Y9^1| j E`.}gQ       }
~2R@2zGb    else {
-osZ].]8~?T       xPos = xPos;*UZ k+}e4j+}~
      }
O(NX9VH/AIY    if (yDir == "down") {&yb R)t|;q
      yPos = yPos + BallSpeed;
Z:I&T m"YeK       } J)X-_\5Se8|
   else if (yDir == "up") {
+LOk;ma!ef1b       yPos = yPos - BallSpeed;
nk|N k[$g       }7K&|8}e(y+c'b(s
   else {
$F f#o3q0h{c"X C       yPos = yPos;]I-O'Luj7z
      }
c{$E.W X|&_ ^    }W&z"_}Ky~
$FAc&ahDn$C[
function hidetext(){&b3b;@ at uv&N
if (document.all)Q&[DZK9k!^-jw
supertext.style.visibility="hidden"
W)t E/fn%}Y else if (document.layers)
O a4m/P5N;F3a9D-D+d m document.supertext.visibility="hide"1H%u b O*n"A
clearTimeout(animatetext)Z2w Pcg,K6Nq9w
}/@#N4U1gC(B+R.|
.Qlz9L%a&T"M`a
if (document.all||document.layers){4X |j;w5a,hg l
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')1g8\Kr6CDM|z
window.onload = initializeBall; r b2t&vDN'D2l"L#w
window.onresize = new Function("window.location.reload()"); yXl K$F?)n4~gZ
}
un WgTb.o$Y d ds:G&]R-POIAt
</script>

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


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