捌玖网络工作室's Archiver

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

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

<style type="text/css">.wn7xz:pfZ+X4k
#supertext {
B ?6e[E U*xx position:absolute;7Pk7{J(BQ,LOn
left:0;$L q.} J!E2`"Rt
top:0;
u uum2eI2BRX visibility:hide;Z'cz!y7L!Ii:B
visibility:hidden;
2c+^]+Q4[:i1s }
jJzz(@w.^\)e </style>
,_t(a V"|"l <script language="JavaScript1.2">HNDfe
<!-- 改变下的字体的大小。颜色-->
wJ!V#[%skm/Nj var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
7g&a _Q2RP(G var hidetimer='';
*A he ` c T[dP_3S <!-- 改变下的弹跳速度-->
p&N,v)}S5IO~ var BallSpeed = 20;
iD!UA9W var contentWidth;
A5oG$B!_ fiO var contentHeight;
.co.gw(j var maxBallSpeed = 50;
'C6e1hs^:J q #kl`%r2Qe

u&f#i:u S t Ab var xMax;^a X!Q5GK Z
var yMax;
&fHB2ay/e:^SX;| var xPos = 0;
a q G!~?!OkN%e var yPos = 0;
RHb4M$XG0m8v7~2B)V var xDir = 'right'; L*|gmA%d
var yDir = 'down';H}5I3_ c5l5{F q,e"w
var superballRunning = true;
Ji`0i_%[@A var tempBallSpeed;GP D*K#sM7]
var currentBallSrc;f!V.J.l+v/[8[$Fm,W
var newXDir;
p j]eZ$p_-k var newYDir; r o f-WT3J

{V"? vJ!@cvg function initializeBall() {~e~/j"C
   if (document.all) {sKmE? PX
      xMax = document.body.clientWidth
a:e_#]6z$Y h+U|R       yMax = document.body.clientHeight Wzw$a6c(Ck
      document.all("supertext").style.visibility = "visible";
6eUt0I:epB2F       contentWidth=supertext.offsetWidth
:^~^\3c       contentHeight=supertext.offsetHeight
F.PP+|?"| K       }
,ta`3h#S4n3I@o    else if (document.layers) {C+n'c8h9h,G
      xMax = window.innerWidth;
\/r"t5HD       yMax = window.innerHeight;~s;AVV G"X)M1s
      contentWidth=document.supertext.document.width
1p~4x$Kd:]h       contentHeight=document.supertext.document.height
*ur"B._m,`x A B       document.layers["supertext"].visibility = "show";
;v$M;d"c hP3m%@2o,m       }
U6V,\XOn'bv    setTimeout('moveBall()',400);
LHV$Yi0ZK^;opu    if (hidetimer!='')
It$S q8oj,V    setTimeout("hidetext()",hidetimer)Teg!m]
   }|%R.d5}#n%Lt~s
Y)~L-x$U;Q
function moveBall() {
xt Rs!o    if (superballRunning == true) {)O;BR/q-}
      calculatePosition();
.{j.a]P4a3T ?E       if (document.all) {}1lN!W L4u f-l)_C@
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
,p_sX5j          document.all("supertext").style.top = yPos + document.body.scrollTop;)UA1h^L(ip ]5O8Dw
         }
$rBDlk)YP9g       else if (document.layers) {#Fk%a!Z+CEn
         document.layers["supertext"].left = xPos + pageXOffset;T#h,S%}ow
         document.layers["supertext"].top = yPos + pageYOffset;PCL#OSj!K8d6Da"LM
         }
$W*f'A:R$t)LM       animatetext=setTimeout('moveBall()',20);
JORz"iM7Id)e+r       }
3N(S q8LM    }4D u1Vn&[o
D C9B \PmN/~
function calculatePosition() {
_7FNAw    if (xDir == "right") {%Bw\2qj
      if (xPos > (xMax - contentWidth - BallSpeed)) {(a6S:C,A6C FW
         xDir = "left";I.E;n@m h r%`;n
         }G BDvUz
      }
.R&Qdtr(SP)r }E    else if (xDir == "left") { s#G TR4f$ku
      if (xPos < (0 + BallSpeed)) {0h"KhIVF4T Y3r
         xDir = "right";
b8L9B:@?#f/U"\&_          }!YD5mz ]9Se
      }1QL'[g%VH
   if (yDir == "down") {*p*y G$k#w|j
      if (yPos > (yMax - contentHeight - BallSpeed)) {o `j$[n q0m"J
         yDir = "up";g2j5m!K3k
         }O6fr.X/l
      }0EZ[H4\Pe
   else if (yDir == "up") {g3{?#t3pla
      if (yPos < (0 + BallSpeed)) {
GI'EMCDb          yDir = "down";a%P6jX,OV
         }+i)?-Ub5^.F!|D
      }$]3y&S&OS@+~H
   if (xDir == "right") { dU-P`$J;t9rd
      xPos = xPos + BallSpeed;/a3m0j9khI*J6~
      }
4z-H1I&}Nx KF    else if (xDir == "left") {
x0Ly#D%y/G5\`       xPos = xPos - BallSpeed;!|)tv4])Ndj
      }Ty${j(Yb9t
   else {
(hL7}'qw"t{E C       xPos = xPos;GVUc]7q$z.kz1E
      }
&l.q V$No)t!bA    if (yDir == "down") {
o;L,?ea w       yPos = yPos + BallSpeed;6D2rKLQjX
      }!P@oT.K u T
   else if (yDir == "up") {lGB'R7}0eK*X3]
      yPos = yPos - BallSpeed;G,v(R5J w,hV t
      }
LX'm*@%ZTV!@`.`7bx    else {4D\H:tC y
      yPos = yPos;C U ]/vBZ
      } G:{]C F
   }4AF3b R"St^1]
!j;M1z zTp X$i lp5b7\
function hidetext(){
\:uy6qlDP8~ if (document.all)F*p$}/M)KZ*yb
supertext.style.visibility="hidden"v H"]S7Ficu
else if (document.layers)
9@;dest vp document.supertext.visibility="hide"3p}$xV|enRF
clearTimeout(animatetext)g K7pbd"?Z6P
}
#y a#m#LH~ .Y,A:rg%@ ic
if (document.all||document.layers){
rQpt1i document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
eE%p2k~*w/X*U|b window.onload = initializeBall;[rK)fbp$HF
window.onresize = new Function("window.location.reload()");
*o{YJP"w^ }
a IO&F(j G gVJ;x c
</script>

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


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