捌玖网络工作室's Archiver

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

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

<style type="text/css">PM.c"JvJ}J
#supertext {
GIl$|+{9i~/O%s position:absolute;
kTr&or8w,e*R3m left:0;
ndO D\6~sMh!x top:0;e2d"_)eu R!M0\4k
visibility:hide;
S9` J0`!] ~8}@ Tn${ visibility:hidden;-f)g6gS)[H
}^}ry1Zlh5KU
</style>S1R+Sx"H c+w ~m
<script language="JavaScript1.2">R`w ZR?,Ktr+G
<!-- 改变下的字体的大小。颜色-->
9Q{/oS8Vh` var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'4VE r c"Tq8G
var hidetimer='';
b~h XUO4X <!-- 改变下的弹跳速度-->e@5uH9EO_
var BallSpeed = 20;/lE(?'PqyRR? r
var contentWidth;
mCiBR var contentHeight;Cbp,I}5S2iy(HxC
var maxBallSpeed = 50;
9L/w,z!?/G
R#h,F6gP(I!Z !n{"O0X#K)wJ ]){
var xMax;(us:~Yj
var yMax;2f z!xRV!tX
var xPos = 0;
2t;f2CPI*Es}&S var yPos = 0;2t j7u:vq/y
var xDir = 'right';.E iBR9n`3h$FIS
var yDir = 'down';
,~.D NKQn4Uy var superballRunning = true;
Q0w,K&|]6YF var tempBallSpeed;7~0W8b/B}9k
var currentBallSrc;
%SZ'kA/lp6]H cE var newXDir;3}o @-_,h4j:D;D$UB
var newYDir;
Vy~ iv3GY |2pJ`Ij ({\_D{
function initializeBall() {
Vv`g6Wj9};c#X    if (document.all) {uT9aoc t!T's'R
      xMax = document.body.clientWidth
|&q!\'@5_S#tG       yMax = document.body.clientHeight
"K0n&l'j_ Y       document.all("supertext").style.visibility = "visible";z.YR xZ&Y;Jz
      contentWidth=supertext.offsetWidth8Ko9v2bxV9]
      contentHeight=supertext.offsetHeight:YoqNzL&dj
      }
PnB'MZ1wU    else if (document.layers) {c&e2`'?-c7sJ
      xMax = window.innerWidth;xQ4H Q6\Dt"l
      yMax = window.innerHeight;#L0_ F1cj2kl
      contentWidth=document.supertext.document.widthB6MQ1E"y/j&E
      contentHeight=document.supertext.document.height
1cp!Je7P,S       document.layers["supertext"].visibility = "show";
2g!a]Ks7z%Q8h ? B       }
N)K w0y p:h:NX    setTimeout('moveBall()',400);
P4Qd;`bd-i    if (hidetimer!='')ECn"}(rN|%A`w/}
   setTimeout("hidetext()",hidetimer)I-FDW)`8Hk#p w
   }%U:KajI"S8d$L)Xu Q

5vsf*er]BV function moveBall() {4D\BD*LKRW+^H
   if (superballRunning == true) {7zA*BS j2]hwYV
      calculatePosition();y5OiGw N
      if (document.all) {1pHAp%}"g
         document.all("supertext").style.left = xPos + document.body.scrollLeft;|vF.Ev)j6H
         document.all("supertext").style.top = yPos + document.body.scrollTop;O.s g0L)AA e"oH
         }pl,GKCg0U _
      else if (document.layers) {
[PBC)P%Y          document.layers["supertext"].left = xPos + pageXOffset;FMPu.PKe]
         document.layers["supertext"].top = yPos + pageYOffset;o#MO _;i|?
         }MVU W z
      animatetext=setTimeout('moveBall()',20);
N.C;VE(QL0Y"k       }$h-@O&eja+L]jR'N
   }+LC{cuy u
*WF&NgG"_z
function calculatePosition() {
)AOqN?C G    if (xDir == "right") {-a2N@2F4G%V.]
      if (xPos > (xMax - contentWidth - BallSpeed)) {
o/M$H1Nw"s/\,PP          xDir = "left";
*_%KN5CS3Gq          }r y{;j:Ua [
      }X W"x p'?!M/v l
   else if (xDir == "left") {D$u_7?$J7n;[x"hr%d
      if (xPos < (0 + BallSpeed)) {
3@:El U;Dd$y          xDir = "right";
M8sf7?r,SX          }'sEEU6t)\H:zz sS%l A
      }
b'Gb(l[-])Mq    if (yDir == "down") {
G;N0l}:kIKh1C9r       if (yPos > (yMax - contentHeight - BallSpeed)) {
2D p+{a6E\,N,l Hw0jK          yDir = "up";
f&LO3KAu|;H          }
Q?vF L@gt       }fWf_%_
   else if (yDir == "up") {(\y M%|0@&w,ome
      if (yPos < (0 + BallSpeed)) {-gZ @YEz[/{%{%]
         yDir = "down";3e0Kz g N
         }
c/G c~ I L7L4L       }
WR}5h U/|5~u i#G    if (xDir == "right") {d$N7A0g!hp;VWT
      xPos = xPos + BallSpeed;1zt L X4YUq
      }
` h1tu#uy6T+}    else if (xDir == "left") {U6xJxs |y6d-t
      xPos = xPos - BallSpeed;
||(P+SQuz0Zg R       }G%G h(}u
   else {
SXitf#M8Vq       xPos = xPos;+@ a5M+r Qj;j
      }
/UeOAjgO    if (yDir == "down") {
4AF?:N3n3W#\ t       yPos = yPos + BallSpeed;"cD:zXY
      }
io^#H8LP    else if (yDir == "up") {/qD2X:j(xwou,G
      yPos = yPos - BallSpeed;
H ?4t[*r H2A%M       }
-kG O-]T%j5I    else {
WD7h!D;K/\M%d#Uo:Ey       yPos = yPos;
c-~uVNRO       }
5^"{^2` YaYW@    }
A$T vm1Z |8^,`]4f5Pr)pFEa
function hidetext(){EOb'D&mb"^,cA
if (document.all)6m%D4p'U \\%C:j jI9n
supertext.style.visibility="hidden"
*]+F{^0qxD else if (document.layers)&y3M1c9ZH
document.supertext.visibility="hide"n^6`~e#I
clearTimeout(animatetext)
K2F2KH&c-Rm(v/C }
Z[1T w:xG __ Nln
if (document.all||document.layers){
Cu}T%@p3R nnyU document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
;Y }uX.zR window.onload = initializeBall;|&Zx6k6kw6jK
window.onresize = new Function("window.location.reload()");
J+q^\ezba }
8R)k Zq3@6~ p
7T*X;}_CcV </script>

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


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