捌玖网络工作室's Archiver

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

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

<style type="text/css">%NW ^ NM#m4Nv
#supertext {:\iQbB;srV
position:absolute;
"[:U:pKq.D:kde-o2y,w left:0;
f \BteYlz top:0;
k!Zh@,bJ8m visibility:hide; ]4b"I,O~3F
visibility:hidden;"X}Vmq&S._ Z)P
}3@3S)M&x5o [|"A o
</style>
a2e$F fB}c'm <script language="JavaScript1.2">
s8G"F1~4p,c8{!a;I@ c <!-- 改变下的字体的大小。颜色-->
$g)gtk$l H6[9L:w var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'9sB;\9h.{ G q8P8Cy9Z
var hidetimer='';(M!b4][1j9VUc*z
<!-- 改变下的弹跳速度-->)F&\)VU!Yx'K}{
var BallSpeed = 20;
I6J5Eo3M6K;f var contentWidth;
p'] JiMv var contentHeight;uI+l5]V2r
var maxBallSpeed = 50;
-i1e5H XEd$~3N }L*p
#h.M|-H;A].oJ8H }&Q
l^ C4^)y,R5n"k var xMax;YDV3P}4\$J
var yMax;1|{JiI*Udiuzl
var xPos = 0;a_@R$Su~ {
var yPos = 0;
2|AA#yr:D*Y6S var xDir = 'right'; l4Q[ UY/D
var yDir = 'down';
\t"r3k9wlyk var superballRunning = true;W3f]s|[s
var tempBallSpeed;
$B&x;p)E[1koT.n var currentBallSrc;:S5\K7uV
var newXDir;
i"AH\%kdz?I"F2I var newYDir;
7p(z%@:sq }oM2p
;R)h*De#Y8v,i!T,pq}q function initializeBall() {
@C@Q/Wv$[.w*K#g    if (document.all) {#qy["l/qZ
      xMax = document.body.clientWidth^ rBk_c4X
      yMax = document.body.clientHeight
pA W%Q:_ET       document.all("supertext").style.visibility = "visible";/A+H!m2v A
      contentWidth=supertext.offsetWidth
8M Ny fz       contentHeight=supertext.offsetHeight
,a!|$}S1ieY/s,Nm8K       }
3D? [xH    else if (document.layers) {
P3H2a L m"?)jM       xMax = window.innerWidth;
Y;V!N aXr1L       yMax = window.innerHeight;Rr1|@YbO;o0Q0u(]
      contentWidth=document.supertext.document.width
r1z+U'c [b7J&\%L8sC @       contentHeight=document.supertext.document.heighto6IH3s)o vMq j/Y
      document.layers["supertext"].visibility = "show";
pruQ~"o6u       } j5B2Sf.g/R/o1PV
   setTimeout('moveBall()',400);
Z'XYuM?YWN    if (hidetimer!='')
(ZwWqp9i    setTimeout("hidetext()",hidetimer)
.h{ jC7k%l;f    }Sb\^?t

A`9ET7y@6g function moveBall() {&Q:J:A[*e;N
   if (superballRunning == true) {
v?a/m5c"z       calculatePosition();
S_!T pz5k)F`       if (document.all) {
/~%W'F8{&XrUQ#m+y7f          document.all("supertext").style.left = xPos + document.body.scrollLeft;{4T(~rG u'G
         document.all("supertext").style.top = yPos + document.body.scrollTop;
jt%L$F1S&C(QA          }&e y;fO-hGe,z[D
      else if (document.layers) {WNJ-wc]
         document.layers["supertext"].left = xPos + pageXOffset;
g;X9v&HkG ^:i          document.layers["supertext"].top = yPos + pageYOffset;1i(oQd Q2V^
         }
P9|+U(\Ku8w       animatetext=setTimeout('moveBall()',20);:[7n$Q9b,_]
      }
RE4d L6BP e    }/GA r^%y
~3@3n3^hR*@
function calculatePosition() {ejd)O {JPN3t
   if (xDir == "right") {
8O,wu Q{OMLzxy       if (xPos > (xMax - contentWidth - BallSpeed)) {#~,XUhuB'b+V`F
         xDir = "left";:tF5nA.V#z
         }
9A)tB hET.mW       }1Zc2SK Emdk!\
   else if (xDir == "left") {
s*^SDrw;b       if (xPos < (0 + BallSpeed)) {
-w9oa#~%^          xDir = "right";f{*s;x*m
         }
6~t3XQ Xg       }~/j&E4x*W7Z6S1H [}
   if (yDir == "down") {
EA&Z0S9P{,x!Q7U9C       if (yPos > (yMax - contentHeight - BallSpeed)) {9RMxt9Z!v/I8x
         yDir = "up";^"v5mj&T3?*}B2m
         }
0uS5~G[!O#q O       } o)B,Rf|2VG@Va
   else if (yDir == "up") {:\-W'|q#pE.|*fl
      if (yPos < (0 + BallSpeed)) {@If\5}N0UQ7i j
         yDir = "down";8TZvJl+S
         }3xq} Q v
      }
P0^'fC(J    if (xDir == "right") {~K'p(U{M
      xPos = xPos + BallSpeed;t-Fo"M@y[:Q1G
      }
-G`!Y4XTRn0l    else if (xDir == "left") {y~A.RR#Pa(k4}xl
      xPos = xPos - BallSpeed;Q2Sga3[YN;F
      }
Zu5l3X3TR?&V    else {IC;q:Yq(\E Q8B
      xPos = xPos;
Yv"h3i5n       }
A9K9Z7odV?    if (yDir == "down") {R*D,xoD!W X? ]
      yPos = yPos + BallSpeed;fz:^ |y-H.|
      }B(@l5Z|"rg(Z7L
   else if (yDir == "up") {4?p3o_K
      yPos = yPos - BallSpeed;Rf*@,]5h
      }
;Z.{9M4j3Gg.hp    else {
5KMi2iqSMZ'q'a ]       yPos = yPos;
Y+eP-}x4E.R       })D3c D]fba'x
   }LXrphQh3_a3k

jk q](C"dm function hidetext(){'yAY Z&[\6L
if (document.all) Fg9g8_9vE;aN(\FL4F
supertext.style.visibility="hidden"
)]"x}2E)E9eY8qR else if (document.layers),o9oh@ [0P
document.supertext.visibility="hide"
B9Z*K7`p clearTimeout(animatetext)Jd|&[8D
}*kL%T`W-GNF

"gv7m.vP if (document.all||document.layers){dJ5d s'h$Y)lL8OR/J
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')3S[j4Ku&G tuW*?
window.onload = initializeBall;QQ,Vt(ZQ0m]-\3{
window.onresize = new Function("window.location.reload()");n*Ks-]#]i'Gb
}@Fg _rh

,G0]A7T a"d#Q </script>

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


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