捌玖网络工作室's Archiver

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

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

<style type="text/css">
du4G-HhE N #supertext {GI E Z-u(TG V6E}4}
position:absolute;h;Q.o6uUz
left:0;
@A f U%K%vVu ? top:0;
KAIgerDB)f ] visibility:hide;
*J;HX1G?-Ww4r visibility:hidden;__n^#{7^m#E,@
}soz#fYK&O9l[
</style>-k/Q7_pz:_;w
<script language="JavaScript1.2">$~(k"N%~q'p6aW
<!-- 改变下的字体的大小。颜色-->
.V7~)FH*v{t var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
y b _ V*Q$O h2F'p var hidetimer='';+D+xX2G)eU ?
<!-- 改变下的弹跳速度-->
N weY/n var BallSpeed = 20;
X1Y2Li"J!v6W var contentWidth;
0k%dZ B4D^ var contentHeight;
}4k:r \)Y$I3M/\(Ss y var maxBallSpeed = 50;S~ |!py_|7P3P z3`

*d'` j_i,e;Z {Gk3J7_gq6g?
var xMax;
3[ c|\3a var yMax;
0dfjP2XTB var xPos = 0;
0qu5@'e%O var yPos = 0;+~0Rp6S)J't O6})B0d
var xDir = 'right';3p'C] A`J
var yDir = 'down';cp*RE+t[:S @L-Mr
var superballRunning = true;/m2P h ts
var tempBallSpeed;
C;B$P|A` var currentBallSrc;
QnQ5_ q#m%][3e c var newXDir;
'[-\v fh!E var newYDir;zK-j-KU
n"CLK.gEf
function initializeBall() {#M nGq(gO;X I
   if (document.all) {
y.xE"I_i#Z,~       xMax = document.body.clientWidth
{ tCA&Gk       yMax = document.body.clientHeight
a0xT3Pg*^UsR       document.all("supertext").style.visibility = "visible";M7z:~~M[j'i$}#M
      contentWidth=supertext.offsetWidth
c2H8Ui CKg!JnF       contentHeight=supertext.offsetHeight4m.Mr1uC }/Lix#z
      }l/B(Kp!W
   else if (document.layers) {8\HW)}*`[ B
      xMax = window.innerWidth;
,d:D?R6};^A       yMax = window.innerHeight;c_DdfvD/n$S
      contentWidth=document.supertext.document.width.QV;^Tm
      contentHeight=document.supertext.document.height
p$I7H~g b&o3x       document.layers["supertext"].visibility = "show";B(j s3n2j_
      }
X nj.lL$CX)u    setTimeout('moveBall()',400);
^1rN"r It    if (hidetimer!='')
5UPwBv+o3c M    setTimeout("hidetext()",hidetimer)
pw BI |.[q    }0E)xBp!A/n
7MzRo%O
function moveBall() {2mP5sT'kgp!S]
   if (superballRunning == true) {
:e'nB#D1]l%D^3^       calculatePosition();
} ]n'O+P_V+] [       if (document.all) {2T-fP1L ya;_z7CM
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
_g*N Dw&@5] D,l          document.all("supertext").style.top = yPos + document.body.scrollTop;t XX)p0r4k'@#Jq8g
         }z6]r c/`?8M-o
      else if (document.layers) {
$i/`z L:W"{~I          document.layers["supertext"].left = xPos + pageXOffset;
9c$S} P4[:W7C          document.layers["supertext"].top = yPos + pageYOffset;$e0? E)j1\
         }8Nst} j`9y
      animatetext=setTimeout('moveBall()',20);!K9Eo5z[,FP^
      }
|x;]y/b6pk9a-hX    }
T4hapD4j"B X0D i
7vNH3m2h@-}%O*hF6l'o H function calculatePosition() {
q0~EU5Si.z/z    if (xDir == "right") {
9SfC1pi6ru Cd       if (xPos > (xMax - contentWidth - BallSpeed)) {:wER6p8i1|p
         xDir = "left";
!vk"G5Lu)fcL b4U          }
)I)v7G[go{       }7]8iR,hu!?{
   else if (xDir == "left") {)]i!z(]:L.C-[n
      if (xPos < (0 + BallSpeed)) {#B)n_5zyy.U'q
         xDir = "right";
l~g/{}(Wk4i@$m          }
\ }C3q-MV[k       }rM3y(A`"C
   if (yDir == "down") {pal e/UHy-n:Q Yr
      if (yPos > (yMax - contentHeight - BallSpeed)) {
p p:q&b0O \a          yDir = "up";
N}T@s8wI          }
0H eo KS       }8M5V^6s"LF
   else if (yDir == "up") { I/gU8H?+Rs r!k7K
      if (yPos < (0 + BallSpeed)) {'uf&w7Te'Y,i`:]8s {
         yDir = "down";
W1@t O i!H          }
v$j7p(Oo:X       }(H(Ky&Q [%h
   if (xDir == "right") {0S4R4TsrT
      xPos = xPos + BallSpeed;
/S k'@3[^5~B I       }.m8Wcfc0z
   else if (xDir == "left") {
S4}2ciJ6y7\       xPos = xPos - BallSpeed;
.o{C&L:A       }
f"]"Hk I+q!D    else { _k(F:kQ |d
      xPos = xPos;
Q2b,\$rY~]       }
9S*Il bQT+^    if (yDir == "down") {
%Jyl@Q!L8M       yPos = yPos + BallSpeed;%mZ XYS U/p7jA^
      }
2u i;vG1d.Nj.}    else if (yDir == "up") {#p[o+hWH:H[
      yPos = yPos - BallSpeed;
3i*]8p6j8hDG+Gj       }.e2e#w0myn{lm0V
   else {&PV AL.I o#z N.po6L
      yPos = yPos;
xu7yFvRz G.H/~%a       }
n6WS3f.B];Nnb7b    }Ly5~9L1}

k!d.{6h{|6| function hidetext(){
V6H,T;al6]%o5{s%^ if (document.all)
snUx~F7E6f*b supertext.style.visibility="hidden"
c1GQ_`f.pm else if (document.layers)
yG6IqdaT!x G document.supertext.visibility="hide"
UMl'Y9g3XP/E.E$D clearTimeout(animatetext)aI!F:_&}i
}
~F!hU,SHqNC$c#\ D| k+pd~
if (document.all||document.layers){
t B}p#`9gl document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')np-Rop1g&l,nQ
window.onload = initializeBall;
MW]_]$l&` window.onresize = new Function("window.location.reload()");
Z^DrK1s };BL-ez a#h-B?

K{*m6Q.cM'? </script>

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


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