捌玖网络工作室's Archiver

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

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

<style type="text/css">
Dy3p_:s B #supertext {pv?oU_
position:absolute;
"HQ$B^q#z:bvu left:0;*{8v;y~t
top:0;
&{v#B:X*{ Cnt visibility:hide;3?,B,E [kH7d:L7]vb
visibility:hidden;,j6rJ+DA"Ly?gJ
}cy"wUD#j7^
</style>(N1i{s A/MK
<script language="JavaScript1.2">
x?$M.p6K5tuR <!-- 改变下的字体的大小。颜色-->
4ed(w1l7SI({2\ var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'+rF_.l S5o
var hidetimer='';
1L-@m)Gl3u.knO <!-- 改变下的弹跳速度-->
(I^cO6ZM)\+] var BallSpeed = 20;s&t4P4x_8P*Xt)b
var contentWidth;8s u CJPN
var contentHeight;
1t-L [M`)w var maxBallSpeed = 50;
AKJH8Do +u x7rUzsx

p/tFX"A9j`G^:j var xMax;Y2R2X:FHq I%KRe%c
var yMax;
Za eNBF5@x9i var xPos = 0;
8T cOa8Q var yPos = 0;M~'X'H%D7Roo_xx
var xDir = 'right';
*ByC/X!ey tuh var yDir = 'down';URQ'aX5C)J!H
var superballRunning = true;bE X(A*C#I-w6r3c
var tempBallSpeed; ~*Q hg \hu'{
var currentBallSrc;mj8i^7X/\
var newXDir;
vl;e/l{ }N var newYDir;nJz;_ w4P8z w

dSi^D)? function initializeBall() {
i|I4|`Z%n"xl    if (document.all) {[ozo/c0?/Xz0O}7h;C
      xMax = document.body.clientWidthz?&M.`r7G/V
      yMax = document.body.clientHeight_/}'iT k*fI
      document.all("supertext").style.visibility = "visible";N3X9q9K"]?9Hyy
      contentWidth=supertext.offsetWidth
SbR\I`un       contentHeight=supertext.offsetHeight
*W*G%R['k0k"_ [v'q1[       }M})]^XF~NN
   else if (document.layers) {G_p5Ev-o
      xMax = window.innerWidth;;On Sz l ?`
      yMax = window.innerHeight;2s'I#\p~ z H
      contentWidth=document.supertext.document.width/Ph6Kk nc&[
      contentHeight=document.supertext.document.height
#Q*uM sq$z%u2t5M       document.layers["supertext"].visibility = "show"; ?tHV%U
      },D%@{e(YXN
   setTimeout('moveBall()',400);
;U&j"c8d#}S    if (hidetimer!='')
c2v i$g9soke    setTimeout("hidetext()",hidetimer)
4S9|*|t y&fk6X    }
!E|;Vjzij ];~X||-^
function moveBall() { VtI1W m6I/V
   if (superballRunning == true) {
3JMX{WDI       calculatePosition();
8R"u|s/R v feW       if (document.all) {5p_[b(ag$p#kqe
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
+@-RM7}P]"R4_          document.all("supertext").style.top = yPos + document.body.scrollTop;
m0S&e2U.XIA          }(Z3s?g8jwQte
      else if (document.layers) {$o9}LMqQ?/M
         document.layers["supertext"].left = xPos + pageXOffset;
^Q(D)]4I M          document.layers["supertext"].top = yPos + pageYOffset;&v!hb)wkP0lU2Af
         }
HwK n%YQ       animatetext=setTimeout('moveBall()',20);
7N9X%zTX@2AE,c7C       }
w3r0~r4G j$|)RrkQ&{B    }~y9ht}

s?9_9u;`e$A@$@ function calculatePosition() {^U1vTl pw+r
   if (xDir == "right") {
IP m/r@#Vd_yN       if (xPos > (xMax - contentWidth - BallSpeed)) {
!bb2SKb          xDir = "left";,\1o+`n8|
         }
9Q8C*Y7o'o-es p;Q       }
{M$v,|G5N&\s+I-^y    else if (xDir == "left") {|6FF|y6T Q0W8|
      if (xPos < (0 + BallSpeed)) {
&M vUjM7\5yyes          xDir = "right";
q Q"{9? W7s          }
+l?C,^ GM*x       }
({h3[p4Ub1RY!V    if (yDir == "down") {
Vkq'w_#R       if (yPos > (yMax - contentHeight - BallSpeed)) {
-H'~&X+x*T9x1_          yDir = "up";
*W9Pw7NC;K}B)Jn          }
:Prd.b"O8j U       }R2aHL"O)V(fr
   else if (yDir == "up") {
a)^'vt.VN R I2A y!j       if (yPos < (0 + BallSpeed)) {Nv!GO \
         yDir = "down";
#BL]s [H'W#A8\          } h,zW$G k
      }
zy$Gy6_ z    if (xDir == "right") {
:jN3{*? l i-Im       xPos = xPos + BallSpeed;
MB_3kl&[       }
e!f W%\7dO)G    else if (xDir == "left") {({5] V}.ccDJ-tAlu
      xPos = xPos - BallSpeed;0g.K|0SIU A z){.^R(z
      }
B,P"z"qv:Z z    else {
\-ZA'Ot       xPos = xPos;
y3o4jtfb-B9N       },|_+?d+S'of v]
   if (yDir == "down") {)hC%Q"{j(_:u
      yPos = yPos + BallSpeed;&C1^P'eZs%X*^
      }
s:NL+T3E @ V S    else if (yDir == "up") {zO.WXfezz-S5lU
      yPos = yPos - BallSpeed;
5ne]*p5E/O"[n       }
+[&Ah H+e.N,]"D3h    else {.Sm$hS+D+R iL
      yPos = yPos;
wR)\TrI[:R       }l c0PP}QbhY
   }
y4l{Pja ;G@/r9t1s1s
function hidetext(){&W y!op{
if (document.all)
X+UP/_1_ E supertext.style.visibility="hidden"
xiD{I else if (document.layers)
8|Av5rhJ*c document.supertext.visibility="hide"-uE%o*]m!yy
clearTimeout(animatetext)I*LUavi hM$g
}
^.ej6ztk 5qY(l }u&r
if (document.all||document.layers){
:e1E'zu1R1J8tc'I-OWz6b0\ document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')D)M$\T D/L#J V
window.onload = initializeBall;
oJ7XpTB"_J9O window.onresize = new Function("window.location.reload()");
-@wjy6b;g }
tYU3D4QU;wYD 9}6Z*^hg*A0^R}
</script>

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


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