捌玖网络工作室's Archiver

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

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

<style type="text/css">k7g:F!Z&l V(O'{b9b:C
#supertext {
7RY:^K,I(jUW/_+` position:absolute;,du;T?t4VZ
left:0;9m*h*ez:W Fv9M
top:0;
m"to7VN$B2] visibility:hide;
X%c5U+[6NB(C visibility:hidden;w { qj:MAplL
} b'Kt}Jp:v ?,[;N
</style>
1H%?0n.ahW{l!qy <script language="JavaScript1.2">nO+kLt~1X%[6k
<!-- 改变下的字体的大小。颜色--> Ob'm j_
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
0kj(tC\{ var hidetimer='';
5k6d:Q(A(| \_Nx H <!-- 改变下的弹跳速度-->
2kxa(fupi var BallSpeed = 20;b{ ^CJ
var contentWidth;
0sLr_AU}RR4y var contentHeight;)x&r7Msh-j0[
var maxBallSpeed = 50;
SA7nR8y2~-pf*` S-J v,@|/}5?;N J x
"cQR m6v
var xMax;
[ bGBsj var yMax;
nV1ncu[!y2v var xPos = 0;[1Lw VP#?6O D.[ ?
var yPos = 0;6b MhRey1RT
var xDir = 'right';(A3spnP9Z2J&|Z5x4_
var yDir = 'down';%}$[!IXP~{u
var superballRunning = true;
e&@9M5I*T var tempBallSpeed;
2B?3^Y1G7La var currentBallSrc;3rG;{ xk+c6j
var newXDir;
-Iq4|yW3F var newYDir;
1KWtb tR 5}QOcy0IR!`
function initializeBall() {
P7HLq#]p I    if (document.all) {
|b]'C"\ n/l2l)nd       xMax = document.body.clientWidth
C6eE m+bo z!dc       yMax = document.body.clientHeight
Z!WI4yJf o ui       document.all("supertext").style.visibility = "visible"; K v ff \!Rb
      contentWidth=supertext.offsetWidthx7F'A W|$kET
      contentHeight=supertext.offsetHeight
u4tF:C4H.G       }
5v1u$e0e$?(f5Zi"i d"Rx y    else if (document.layers) { Y%k g|i'Q
      xMax = window.innerWidth;
I np,wf       yMax = window.innerHeight;
s8ZOU:As hwm3y       contentWidth=document.supertext.document.width7oHP2^ o Ye0]9C)o
      contentHeight=document.supertext.document.height
dW6kzl^VS       document.layers["supertext"].visibility = "show"; P2nS,t#c:r2{
      }^m#Pl D
   setTimeout('moveBall()',400);8yb l L4}"]O w+o
   if (hidetimer!='')
R0}-OTR(D+A L)q    setTimeout("hidetext()",hidetimer)
P$n%i4Hn`]1p:\#j/J    }:C h*E%C1_@P f

~Mb#g;k'e*WL.? function moveBall() {C9H8B2f&N,}'u-w H tp1A
   if (superballRunning == true) {1us+| r`C8| |
      calculatePosition();dF^qN H }5?F4eP:g*T
      if (document.all) {5vDQ O`4?:f
         document.all("supertext").style.left = xPos + document.body.scrollLeft;8u?[?W$]:X&Is7j
         document.all("supertext").style.top = yPos + document.body.scrollTop;
C8nO8^fUq ^O          }
8y-l$pskG0uck       else if (document.layers) {-ro ^oE6_,uj
         document.layers["supertext"].left = xPos + pageXOffset;
.D4m3uo0Kb0].y wl          document.layers["supertext"].top = yPos + pageYOffset;%U)S V~&D/~q
         }
4\4TCl3Bf       animatetext=setTimeout('moveBall()',20);;v v^,KVQ!nK
      }*V8Bo3tO)U
   }
?6P\ |T |4^4? F-@6n @ a3N"IY
function calculatePosition() {
#b*UPA5JQH(`    if (xDir == "right") {/S g~,@W|:NwQ3_$J
      if (xPos > (xMax - contentWidth - BallSpeed)) {Jo8K#h |?y;Dd
         xDir = "left";5}9L;F0|4}*pr"v.{d
         } kp._x!^TQ
      }tW&IS8c%` S
   else if (xDir == "left") {]eGE5C p
      if (xPos < (0 + BallSpeed)) {#@C-c Q'VU!|
         xDir = "right";w8ZaL/U
         }
3cGY1[*d@       }:b.]!orUBK ],U
   if (yDir == "down") {
L@.N|&W d#w4J#I       if (yPos > (yMax - contentHeight - BallSpeed)) {
OP0N`)@.?*x          yDir = "up";le?cMl4_[ p
         }'o)OG^RI a
      }
K5Hl+H*z7V7m%T    else if (yDir == "up") {)N u%y&k,} Q}2z1E7f
      if (yPos < (0 + BallSpeed)) {
U;CO1AR:XMz"{          yDir = "down";4e*N1tQ sS
         }(a w%Z$i1s%ks[ s
      }*I?Q[4u'fL
   if (xDir == "right") { W/]njv$x
      xPos = xPos + BallSpeed;
keE%V:p UmH       }
0GZ!r[w&yah8q \    else if (xDir == "left") {kf3C0s dM
      xPos = xPos - BallSpeed;i/E L#{.b-OYD
      }2T~YM S
   else {
4K0r2Q"M6QHI!A       xPos = xPos;
(xIg8q)GA*q       }!Nd Zi}U*S8}
   if (yDir == "down") {
gp(gR[M"w;eM       yPos = yPos + BallSpeed;
8X [ S#S"S |       }x X3K;d-Ra{O
   else if (yDir == "up") {[W |0D6kSI`
      yPos = yPos - BallSpeed;
hKNe f5_{:g       }
&w mI:m/l    else {8Wq G[._T0e5P1F
      yPos = yPos;
%@tpL%}[       }*v1~+vTE`
   }
N4h-GAOROr 5g5Y5o*Z6UEL3Y;P
function hidetext(){.Y9J8b@^8drr
if (document.all)
}7Mf%Ar)v+`:v supertext.style.visibility="hidden"
$P!Kbq q)OI else if (document.layers)
C#a/I,v I3sF%K document.supertext.visibility="hide"JR1G!k1] v
clearTimeout(animatetext)
2rR|.\:`X1N#qLf']'} }
z$W$Wk0OaT%{Wj:N A 7E v;B9fGGM_
if (document.all||document.layers){
,I'z mM?pEWn document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>') K/v)d8|pr/o b$H
window.onload = initializeBall;5G9^B[:O%~7W
window.onresize = new Function("window.location.reload()");
\I4E-p3a m }*k"m5@R6AB&}4D
HLjE%B9w4s
</script>

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


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