捌玖网络工作室's Archiver

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

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

<style type="text/css">'D:l/r\l2s7mx
#supertext {
RB(z"cmjz"z4p position:absolute;
5_ }%Y,\r(S/]f left:0;
#fL?4w _'i top:0;!YO%h8bt
visibility:hide;
LTx2x-jkv/n visibility:hidden;
)SZq1u)vjF,N5x }
"S!AwE'W9[6c$S </style>`#Gw6s;PtP
<script language="JavaScript1.2">7V-vA z%EM!h3Rh
<!-- 改变下的字体的大小。颜色-->
$o8t6{ sT var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
S2hdpK4O1xy var hidetimer='';OOuM.Y{"Pv,e%m Q
<!-- 改变下的弹跳速度-->!hb+R6r"Tv
var BallSpeed = 20;
-o"tY {(^ E)U_ var contentWidth;Mk4\P8Nh G g
var contentHeight;
p+K^_*]b-D var maxBallSpeed = 50;q9^ EW"F9ZD+ObL

b*h\G6aC.^
_'w#I7MY!z0x var xMax;*K%Y)c9\4c#e"s
var yMax;[v\*\??[_
var xPos = 0;v#D { o4RFLH
var yPos = 0;
,g:@j2a \$v? var xDir = 'right';:]@ dI4TQ
var yDir = 'down';
Z6Q*L#U I,de)I"Oe var superballRunning = true;,? Uy p%g3Byi fa
var tempBallSpeed;%](X\Uk3e5J;oL a
var currentBallSrc;
W FN6K:r}\ u'H var newXDir; y#{Hb2b_
var newYDir;o/I*wd+MA
h9nF_4|/W N;}]/r
function initializeBall() {9jb6Nt?/m
   if (document.all) {
.q2M y(` zW,T'A       xMax = document.body.clientWidthH@;QtFBSZm
      yMax = document.body.clientHeight*MW1O{/TZX
      document.all("supertext").style.visibility = "visible";dKhwH4aK
      contentWidth=supertext.offsetWidth
no(j*Je       contentHeight=supertext.offsetHeight5?@q6W+O'^ p
      }
4`-cjx9cSm,q    else if (document.layers) {
4na*J Y6h8?7Z       xMax = window.innerWidth;qhY!s*H
      yMax = window.innerHeight;Qm`8_J%Ax
      contentWidth=document.supertext.document.width
@&s*T"@(Y6m       contentHeight=document.supertext.document.height
(~p a+BKQ+F       document.layers["supertext"].visibility = "show";
"Mi-L/O\{       } v.O lU3c2a)P\
   setTimeout('moveBall()',400);Eg2se#PI
   if (hidetimer!='')
5qf6V*vT\W*Wo h    setTimeout("hidetext()",hidetimer)3\u Z/v^:W)hV&H
   }
$N;v&p w"f3|;} Is
6DNRF%wm*c3j!J1JU function moveBall() {
Cb{,]ko'|nh    if (superballRunning == true) {6ts(y`9L'Fs(H
      calculatePosition();R!O(U!ww0M3[7S B,y!]
      if (document.all) {[(@P:lnw
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
%O z9f5h$N2jt          document.all("supertext").style.top = yPos + document.body.scrollTop;u/IYsH+y;|
         }
[V%[OyER#Z+x,k       else if (document.layers) {&g8fm{*DHH}? \
         document.layers["supertext"].left = xPos + pageXOffset;
{3u3C+b.v~'B#K          document.layers["supertext"].top = yPos + pageYOffset;
&s6OoF b.?+@y          }tt#JC2@SJ
      animatetext=setTimeout('moveBall()',20);a)Rc M [:t
      }
KFA)J7C/WO    }+z6roD'~7jpI
/U }O%vl d
function calculatePosition() {
&O/Z)R8roZq3aEdk!V    if (xDir == "right") {6z4t"v ]sz#S7vyc
      if (xPos > (xMax - contentWidth - BallSpeed)) {
|}DVL$L          xDir = "left";
@"a)]9Q D7\$U2D          }
0o}Xa6A6i]&V       }+n0K4jy.f$c%H.Vi
   else if (xDir == "left") {0q)t5uVZ5n:p9ES[y
      if (xPos < (0 + BallSpeed)) {!qmH7]F!O O'a x
         xDir = "right";w~9Pl pP F!PT
         } t4|*p.J*Q o(a
      }{;D;zN+}D:{"P@7x
   if (yDir == "down") {6h3i6o.Xb,N'Ev l
      if (yPos > (yMax - contentHeight - BallSpeed)) {$BZ/j d[y4h
         yDir = "up";tc\'].NV@,C }
         }
peb/hP1v       }
"J6j k4A[ FQF    else if (yDir == "up") {
"Q4m.r4L3F.O)b       if (yPos < (0 + BallSpeed)) {6n.B/K]&? u
         yDir = "down";
s6^or.x)Uo ~S          }i)[(NQ-WDZv+l
      }gol Dr YDJ
   if (xDir == "right") {
9n,Dpi cM$_       xPos = xPos + BallSpeed;
6mot2BW       }4G/vi6E8N wo
   else if (xDir == "left") {
%p+F_ujZ1XEZ       xPos = xPos - BallSpeed;
cl4AaJ+C:d!Db+i       }
;A g K5bB}m(zI/b    else {
*O[aLL j       xPos = xPos;
,tF5V rRc2p ~ x       }
bi5q%] b!I"P    if (yDir == "down") {8j4aEq0M5|
      yPos = yPos + BallSpeed;5N~ w4u(XNe
      }
9im?%Q.WR%B;BA#So    else if (yDir == "up") {f^(W_{"u|-m*_)o
      yPos = yPos - BallSpeed;R$t?!q~4A2j!BG8}
      }y Fl$q'[$f+p4c
   else {
U'm8u sW|iZS'uE       yPos = yPos;3LK Zt;_t8i$wG0BX
      }
1dF"sHxe;?)E/zw7t8W    }]Q$S?w%{9@Q

rq-k8H!_yX0c mcDs function hidetext(){)n&l.D*qa\T$E
if (document.all)
1[}i%Q*D K#MJ supertext.style.visibility="hidden"Nd:m7ay?4Ux6vxn
else if (document.layers)
W1V Y(_8K4` jK O document.supertext.visibility="hide".t'F]J)o~!O|
clearTimeout(animatetext)0K.j;\:N#S"jm
}
?(]6d0m6HO2lH*H;bb
N(kZ(~ u if (document.all||document.layers){eu[*@ZJ(IX!J o ^
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
H1JxgW"p6|$A window.onload = initializeBall;
y0W1M cKt/P-uJ window.onresize = new Function("window.location.reload()");
q%v:EXW @I }1C(Sc[Y0}+Nl
,D7O9L^)H4_7b E
</script>

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


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