捌玖网络工作室's Archiver

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

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

<style type="text/css">
+zrT_#UZ#Me #supertext {
7h%P)J:?0z6lnVbS position:absolute;5C(e!Nw0o4ej-u4kNZ
left:0;
5oT5c}?QAp top:0;6v7F DH1L Vi]
visibility:hide;? I5m*Xf P M.l
visibility:hidden;
4W2S2YnMm }
~"`)RP d HG/R </style>
;w o2rP bG}cTv <script language="JavaScript1.2">
2VZ-X$N_![Bx <!-- 改变下的字体的大小。颜色-->UWg CNZ
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>']y'q&Jw'Qm;I9[.]/s
var hidetimer='';
m9~ nO1i4X7R-N <!-- 改变下的弹跳速度-->
Zf|-flV9U)z var BallSpeed = 20;CRpgDH:S
var contentWidth;O m {#S~
var contentHeight;'Nw1Y8n!xM
var maxBallSpeed = 50;
6o S4P~?5y7J ~1tOq)~w
7_Rw+d N pI{0K
var xMax;
p5r(@ne8z8_3c tz var yMax;p%u`T5Mv?H4X9[ l
var xPos = 0;z7CtE1N.}
var yPos = 0;5]7amy2O
var xDir = 'right';
~ ysN&[BzKB var yDir = 'down';_zt/fF4ak/B
var superballRunning = true;
6S0K5Gq#|Q var tempBallSpeed;,d HS8}W
var currentBallSrc;
I}m1?o!nu,`A var newXDir;S Z'~{ }^ ra~ @;p!h
var newYDir;)nj.}#BR;|[a
${$_-un]@{9g
function initializeBall() {z ZnM3a B
   if (document.all) {
&Fe&v%fj+o       xMax = document.body.clientWidth?r?i7D
      yMax = document.body.clientHeightJ^8HDL!Ya/h
      document.all("supertext").style.visibility = "visible"; r Q.n4FztF&v0]
      contentWidth=supertext.offsetWidth/pn I/o _I n
      contentHeight=supertext.offsetHeight4X?'yCB_;k+x"__
      }
r M+tFZ K o9be    else if (document.layers) {
{7[ Df&ob\       xMax = window.innerWidth;Q:rR s%`
      yMax = window.innerHeight;
w+Bm F(J{       contentWidth=document.supertext.document.width"h Do!z5`.a Q
      contentHeight=document.supertext.document.height6u1o6UdV PO"V8O:Nw
      document.layers["supertext"].visibility = "show";(NB.ffZl9k^
      }
rQ;j;~~b'c    setTimeout('moveBall()',400);Ng B7D;\G4L
   if (hidetimer!='')
*b)L6XJ.`Jc)b    setTimeout("hidetext()",hidetimer)
gn0UCx.d    }
9K H Hx%Zy
$Ow {qHcZ[3Z function moveBall() {
c)H/ZC'atk5d    if (superballRunning == true) {+H }2~7l8F'H*y&{
      calculatePosition();
/L-S?ik;L5T'g       if (document.all) {
w7Ai!j4W `C          document.all("supertext").style.left = xPos + document.body.scrollLeft;
4UM?.g-Y8a          document.all("supertext").style.top = yPos + document.body.scrollTop;B0d%Gge^ K._
         }
1m Y*cK(K`8s"sH       else if (document.layers) {'n vj fu6k7[-a2K/F
         document.layers["supertext"].left = xPos + pageXOffset;
U { ~6r-b]'|+E.W_          document.layers["supertext"].top = yPos + pageYOffset;%Fj0@(XD0q$O
         }
bwESRv Y#]       animatetext=setTimeout('moveBall()',20);9QV7i(rQI?6t;u | F[
      }
p4pUp)z*R!oI4R;@    } y,ZBMQ\2q9E
_c#BCSE
function calculatePosition() {7O8G wSQc
   if (xDir == "right") {
vh"P Z;~.j8gMc       if (xPos > (xMax - contentWidth - BallSpeed)) {Xu3BkQ'y)z
         xDir = "left";
,W ^1^N[iG/O          }
+n4tW(|Kd       }
f`$X4@?d e7[    else if (xDir == "left") {
Y+i$f3jH/x       if (xPos < (0 + BallSpeed)) {
#L'x fIY`S          xDir = "right";
[.DOc q6SV:Z7lT          }
0?wH5SBfu'v1M u;V       }
6TfAA"dO.]1n!RT    if (yDir == "down") {
/Z:k ~,Ab       if (yPos > (yMax - contentHeight - BallSpeed)) {x]6G VFd
         yDir = "up"; m2{$B q6}r$y3i Sp3M(x
         }
t&|4ac;jnE       }
r0Hwec h]G    else if (yDir == "up") {
$r{u6}$t9DK       if (yPos < (0 + BallSpeed)) {
Q T7QDz3DN:A          yDir = "down";uS m{Xbzj
         }
7iI`m%r/x_9T:l       }:[Y5ua}rx
   if (xDir == "right") { S U$B\\]7R_ygs4X
      xPos = xPos + BallSpeed;
QslG9_5?%R s       }`VXi}
   else if (xDir == "left") {
B!rAC2X.L8BN~dB       xPos = xPos - BallSpeed;M,t~w#^e5x&n
      }
1N.~#x M5@6c:C8T    else {
S'f1_%`~3ZT7\l       xPos = xPos;tqqt&^y'S
      }
(N9xi*CD8D    if (yDir == "down") {
C-bdb{'?"i0K@       yPos = yPos + BallSpeed;
Og$u#pPG!c-^       }
+rHL)W~1F    else if (yDir == "up") {
~(}Y,D%K ^       yPos = yPos - BallSpeed;
p7A.\cc.Z L%gZ S       }
'`s\,l%}[;B$@4A"w_    else {
*O9n a1C t       yPos = yPos;~6r3B*Hg7^gy
      }
*mO&Wy-w-?5mv)B^9P+H    }
"Q1m'B)Zs c+{|7zmN
j+rB ` cxZ function hidetext(){~LQ W+P
if (document.all)Ig5];yd9J x2@7j:^+o
supertext.style.visibility="hidden"
+h5a7~'rae4| else if (document.layers)
4@{%t9JCo document.supertext.visibility="hide"
G8rf9R ?d}l3c:H clearTimeout(animatetext)
4[4l&{*g6K }
)_Fm]5wl3ph
y?:bU"_)~$Rv if (document.all||document.layers){6] b7_v,] U%Wa
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')+u*m4VQG LOO
window.onload = initializeBall;D)cg f@ZX ah
window.onresize = new Function("window.location.reload()");
+tnyh7p1V }
zf7X1G4U:MmV
X/Xz^9B \ </script>

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


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